laziness, impatience, and hubris | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Here's what's happening; a list in scalar context will return its last element. @array[0..2] will return a list, and in @{}'s scalar context, the last element will be returned, which is the last array ref, that's why you get the last array's item 3 only. Here's a workaround:
He who asks will be a fool for five minutes, but he who doesn't ask will remain a fool for life. Chady | http://chady.net/
Are you a Linux user in Lebanon? join the Lebanese Linux User Group.
In reply to Re^2: Extracting columns from a two dimensional array
by Chady
|
|