##
my $ftp = Net::FTP->new( ... );
if ( defined $ftp ) {
$ftp->func1( ... );
$ftp->func2( ... );
$ftp->quit;
} else {
warn "Hey, this thang ain't workin! $!\n";
}
####
$SIG{__DIE__} = sub { warn shift and exit };
my $ftp = Net::FTP->new( ... ) or die $!;
####
sub ftp_stuff {
my $ftp_ref = shift;
$ftp_ref->func( ... );
$ftp_ref->quit;
}
my $ftp = Net::FTP->new ? ftp_stuff $ftp : warn $!;