foreach my $ref (sort { $b->[3] <=> $a->[3] } @bigarray) { foreach my $cell (@{$ref}) { print "$cell;" } print "\n"; }