Perl's inbuilt sort function sorts array in ASCII character code. But to sort an array numerically we can use the space ship operator <=>.
@array = sort { $a <=> $b } @oldarray;
Here is an example:
@array = (5,3,2,6,8,12,15);
@sorted = sort { $a <=> $b} @array;
print @sorted;