I was about to suggest ls instead of dir, but it looks like mifflin beat me to it. So instead I'll point out that your '|| print .. ' statements are not ending the script, thus you will get errors in all the following code, if for example your $ftp = new Net::FTP .. fails. (And assuming you are using at least the 'warnings pragma, else it will just complain siliently.)