Why not just
<>; print sort { $a <=> $b } <>; [download]
In reply to Re^6: Sorting challenge by hdb in thread Sorting challenge by PerlSufi