Yes, these two are exactly the same, except for one gratitous reference-dereference round trip.
If you dereference a reference and take a reference to the dereferenced reference, this reference will be the same as the original reference.
#!/usr/bin/perl -l $h = {map { $_ => 'fish' } qw(one two red blue)}; print $h; print \%{$h}; print \%{\%{$h}}; print \%{\%{\%{$h}}}; print \%{\%{\%{\%{$h}}}}; print \%{\%{\%{\%{\%{$h}}}}}; print \%{\%{\%{\%{\%{\%{$h}}}}}}; print \%{\%{\%{\%{\%{\%{\%{$h}}}}}}}; print \%{\%{\%{\%{\%{\%{\%{\%{$h}}}}}}}}; __END__ HASH(0x17ea548) HASH(0x17ea548) HASH(0x17ea548) HASH(0x17ea548) HASH(0x17ea548) HASH(0x17ea548) HASH(0x17ea548) HASH(0x17ea548) HASH(0x17ea548)
Sorry for so may ref-deref, couldn't stop... %-)
In reply to Re^9: Syntax for casting map to a hash or an array
by shmem
in thread Syntax for casting map to a hash or an array
by cbeckley
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |