use strict; my @f = qw(leo and magalena went down to the basement to get some good scotch they had hidden from their uncle); @f = sort {$a cmp $b} @f; for (@f){ print "$_\n";} #### my @sorted_files = split(/\n/, `ls /home/myself/ -S -r`);