my ( @temp, %authors ); @temp = sort map { my @b=split; $b[2]; } `ls -l /path/to/authors`; #### foreach ( @temp ) { $authors{$}=1 if not $authors{$_} and length $_; } #### print "$_\n" for keys %authors;