Does it really have to be a ref to be anonymous though? The most common use of anonymous arrays and hashes for me is in return values for subs:
sub foo{ return { bar => 'baz' }; }
You could just as easily return an anonymous hash:
sub foo{ return ( bar => 'baz' ); }
The other common place to see anonymous hash and array refs (always refs in this case) is in constuction of multi-dimentional data structures:
my $foo = [ { bar => 'baz' }, ];
So the arrayref isn't anonymous, but the hashref that is the first (and only element) is.
perl -e 'split//,q{john hurl, pest caretaker}and(map{print @_[$_]}(joi +n(q{},map{sprintf(qq{%010u},$_)}(2**2*307*4993,5*101*641*5261,7*59*79 +*36997,13*17*71*45131,3**2*67*89*167*181))=~/\d{2}/g));'
In reply to Re: Anonymous Data Structures
by agianni
in thread Anonymous Data Structures
by PerlPhi
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |