64/2829 1/349834 37823/8338 5/989328 #### 1/349834 5/989328 64/2829 37823/8338 #### sub sortbyfirst { my ($f_a, undef) = split(/\//, $a); my ($f_b, undef) = split(/\//, $b); return $f_a <=> $f_b; } @sorted = sort sortbyfirst @numbers;