in reply to Anonymous Data Structures

Anonymous hashes & arrays, as you stated, are just hashes and arrays that don't have a name. They are only useful when used as a reference:

my $hashref = { A => 1, B => 2 }; my $arrayref = [ 1, 2, 3 ];

You would then access the elements of the references using ->:

print $hashref->{B}; # 2 print $arrayref->[2]; # 3

or by

print %$hashref{B}; # 2 print @$arrayref[2]; # 3

I much prefer ->, for what it's worth

Replies are listed 'Best First'.
Re^2: Anonymous Data Structures
by blazar (Canon) on Jun 04, 2007 at 08:21 UTC
    I much prefer ->, for what it's worth

    As a general rule, /me too. Though as with most things, there are situations in which it is best suited and situations in which the other way is preferable. Also, they're not equivalent in all respects.