cormanaz has asked for the wisdom of the Perl Monks concerning the following question:
I feel like I should know this already, but I don't. Is there a shorthand way to get a "column" slice of a 2D array? For example, given @a = ([2,4],[4,5],[8,6],[10,7]); how would I get (4,5,6,7) other than writing for $i (0..$#a) { @b = $a[$i][1] }?
TIA...
Steve
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Column slice of a 2D array
by BrowserUk (Patriarch) on Aug 26, 2011 at 00:39 UTC | |
Re: Column slice of a 2D array
by ricDeez (Scribe) on Aug 26, 2011 at 04:02 UTC |
Back to
Seekers of Perl Wisdom