# use <=> instead of default cmp @array = sort { $a <=> $b } @array;