in reply to Re: Net::FTP and standard output
in thread Net::FTP and standard output

Isn't this the sort of thing that eval is good for?

eval { my $ftp = Net::FTP->new(...) or die "Can't connect: $@\n"; $ftp->login(...) or die "failed to login:".$ftp->message; $ftp->cwd(...) or die "failed to chdir:".$ftp->message; ... }; warn $@ if $@; # or whatever

UPDATE: Shortened and fixed typo, per runrig.

    -- Chip Salzenberg, Free-Floating Agent of Chaos