#!/usr/bin/perl use warnings; use strict; my @a = qw(6 3 1 4 2 5); @a = sort(@a); foreach my $i (@a) {print "$i\n";}