Problems? Is your data what you think it is? | |
PerlMonks |
Re^3: Transpose a matrix of charsby ysth (Canon) |
on Jul 04, 2005 at 22:42 UTC ( [id://472322]=note: print w/replies, xml ) | Need Help?? |
pop only works on an array, not a list; try a list slice:
though in this particular case, you can just reverse the sort and use a list assignment: Nit: I think of "max_cols" as being maximum number of columns found, but you are wanting one less than that, the maximum column index, so I called it max_col instead. And I think @$_ - 1 is pretty ugly compared to the elegant $#$_ :)
In Section
Seekers of Perl Wisdom
|
|