in reply to Query on References
Another way to look at it is to realize that in Perl, different basic types can have the same name. There has to be some way to distinguish between, e.g., a hash and a scalar containing a hash reference. The -> (arrow) operator (see perlop) makes this syntactic distinction, as it were. Below the top level, nested hashes (and arrays) can only be references, so the compiler does not need an arrow operator for disambiguation (but an -> can always be used at lower level(s) if you wish).
See also The Perl Data Structures Cookbook.c:\@Work\Perl\monks>perl -wMstrict -le "my %hash = ( 'structure' => { 'uses plain sigil' => 'dereference' } +); my $hash = { 'reference' => { 'needs -> operator' => 'at top' } +}; ;; print $hash {'structure'}{'uses plain sigil' }; print $hash -> {'reference'}{'needs -> operator'}; " dereference at top
Give a man a fish: <%-{-{-{-<
|
|---|