Another problem with the originally posted code is
push (@{$temp[$i]}, $list[$count]);
$count += 1;
because $count just keeps getting bigger and bigger. Try putting a print $count, "\n"; statement just before the return @temp; statement in the original sortList() function definition: is there anything meaningful in $list[$count] or anywhere near this index?
Another approach is to use the Data::Dump module or one of its ilk and put a dump statement after a call to sortList() to see what you have:
use Data::Dump;
...
my @ra = sortList(0..37);
dd \@ra;
In reply to Re: 2D arrays
by AnomalousMonk
in thread 2D arrays
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |