...omitted for clarity... print "Connecting to $url ... " ; if ($ftp = Net::FTP->new($url)) { $opt_v and print " as $userName ..." ; if ($ftp->login($userName,$password)) { print "\n" ; $opt_v and print "Changing to directory $sourceDir ..." ; if ($ftp->cwd($sourceDir)) { $opt_v and print "Getting $flatFile ... " ; if ($ftp->get($flatFile)) { print "done"; } else { print "failed to get file\n" ; } } else { print "failed to change directory\n" ; } } else { print "failed to login\n" ; } } else { print " connection failed\n" ; } $ftp->quit;