I'm only guessing (having never used
NET::FTP in anger), but the docs suggests that using the
ls() method on the NET::FTP object (c/w
dir()) would yield the required list...
Also, note that grep can be used in the foreach loop to the same effect i.e. foreach (grep ....
A user level that continues to overstate my experience :-))