in reply to The @$ array construct
That iterates through @aoa aliasing each element to $_ and then the array reference in $_ is being dereferenced in the print statement. So to access individual elements we just dereference them like somy @aoa = ( ['a' .. 'c'], ['d' .. 'f'], ['g' .. 'i'] ); print "[", @$_, "]\n" for @aoa; __output__ [abc] [def] [ghi]
See. tye's References quick reference and perlreftut for a good starter on references and dereferencing.my @aoa = ( ['a' .. 'c'], ['d' .. 'f'], ['g' .. 'i'] ); print "first element - ", $_->[0], "\n" for @aoa; __output__ first element - a first element - d first element - g
_________
broquaint
|
|---|