use strict; use warnings; my @list2 = sort { $a <=> $b } @list;