#!/usr/bin/perl
#Program name: perlsort4.pl
#  sort numerically using a subroutine (with spaceship operator).
#  numbers are given in a file (specified on the command [one number per line])

$x = 0;
while (<>)
{
  $someList[$x] = $_;
  $x++;
}
@sortedLines = sort numbers @someList;
print @sortedLines;

sub numbers
{
  $a <=> $b
}
