You could try using a hash to remove the duplicates or use opendir to open the directory. This is the easiest way that i could think of.
Here is how you could remove the dups.
my %DupKiller;
foreach $f(@filelist){
###Do Your Processing Here
$DupKiller{$f} = 1;
}
my @store = keys(%DupKiller);