I am using Net::FTP to write some code that connects to
an FTP site scans the directory structure and reports by
email on files which have been updated since the last
scan. When I do $ftp->dir() I then use a regex which searches
for start-of-line followed by either a d or an l in order to
separate the directories from the files. This is so I can scan
directories and check files. My problem is that files which
are symbolic links (lrwxr-xr-x in the dir output) could point
to either files or directories. My workaround, which I am not
too happy with, is to first assume that they are directories
and $ftp->cwd() into the directory checking return codes as I
go. When there has been an error I then know that the link was
not pointing to a directory but a file so I put it on the file
list instead.