http://qs321.pair.com?node_id=263706

Cirollo has asked for the wisdom of the Perl Monks concerning the following question:

I have a 2D array, and I want to return just a "column" of the array. For example,
@ary = ( [1, 2, 3], [4, 5, 6], [7, 8, 9] );
So, I want some function that would return (1, 4, 7). The best I've been able to do is this:
map { $_->[0] } @ary[0..$#ary]
This doesn't seem very "nice," and I don't like the map solution because it isn't terribly suggestive of what the code actually does. Anyone have a better way to do this? Maybe something with hash slices? @ary[0..$#ary][0] doesn't work.