You need to use sort. The probem is, by default, sort sorts lexically ( aka asciibetically). You have to override the default search to sort numerically like so:
Code:
#!/usr/bin/perl -w
use strict;
my @numbers = (123, 32, 456, 44, 54345, 434534545);
my @sorted = sort { $a <=> $b } @numbers;
# use can also use $b <=> $a to sort in reverse order
print "Content-Type: Text/HTML\n\n";
print '<pre>' . join(' - ', @sorted) . '</pre>';