in reply to Anonymous Data Structures
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 |