The output may be like this:
value_2_1
value_2_1
It is because -> is omittable when it's between [ ] or { }.
The output may be like this:
value_2_1
value_2_1
It is because -> is omittable when it's between [ ] or { }.
#! /usr/bin/perl | |
my %hash_1 = ( | |
attr1 => "value1", | |
attr2 => {attr_2_1 => "value_2_1", attr_2_2 => "value_2_2"}, | |
); | |
print $hash_1{attr2}->{attr_2_1} . "\n"; | |
print $hash_1{attr2}{attr_2_1} . "\n"; |