http://qs1969.pair.com?node_id=1165222


in reply to Re^3: Net::FTP
in thread Net::FTP

Untested:

my $logged_in = eval { $ftp->login($un, $pw); 1; }; if (! $logged_in){ if ($@ =~ /login incorrect/i){ # do stuff, perhaps keep asking user for un/pw and # re-attempt login in a loop } else { # might not be a login error... # handle different exception } }