in reply to Helping with sorting
What it looks like you want is for @sorted to be a list of your sorted values, which at the moment, it's not...my @sorted = join("\n", sort {$b <=> $a} @array); print foreach @sorted;
And you'll see what I mean.my @array = qw(2aa 2ba 12kf 9cn 9vn 21sg); my @sorted = join("\n", sort {$b <=> $a} @array); print $#sorted; # Prints the index of the last element in the array @sorted = sort {$b <=> $a} @array; print $#sorted;
|
|---|