my @GPS = grep { -f "$new_dir/$_" } readdir($dh);
It looks like the OP is on Windows so this is a bit OT but if you were on *nix you might want to consider adding and not -l "$new_dir/$_" into the grep depending on how you want to treat symbolic links.
I hope this is of interest.
Cheers,
JohnGG
In reply to Re^2: Catching . .. in file listing
by johngg
in thread Catching . .. in file listing
by deadpickle
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |