#!/usr/bin/env perl # Copyright 2005 Daniel Cer (daniel.cer@cs.colorado.edu) # # This work is licensed under the Creative Commons Attribution-NonCommercial- # ShareAlike License. To view a copy of this license, visit # http://creativecommons.org/licenses/by-nc-sa/2.5/ or send a letter to # Creative Commons, 543 Howard Street, 5th Floor, San Francisco, California, # 94105, USA. if ($#ARGV != 0) { print stderr "Usage:\n\t$0 (file with numbers to sort)\n"; exit -1; } $file_name = $ARGV[0]; # read in the items open fh, $file_name or die "Can't open $file_name\n"; @items = ; close fh; # sort them @items = sort {$a <=> $b} @items; # display the results foreach $item (@items) { print "$item"; }