U
usenet
Greetings. Kindly consider, if you please, this trivial sample script
which illustrates my question:
#!/usr/bin/perl
use warnings; use strict;
use Net::SFTP;
local $SIG{__DIE__} = sub {
print "Oh no - I'm dead!\n";
};
my ( $host, $user, $password, $local_file, $remote_file ) =
qw{ myhost myname mypasswrd junk.txt junk2.txt };
if (my $sftp = Net::SFTP->new($host, (user => $user,
password => $password,)
)
) {
$sftp -> put ($local_file, $remote_file)
|| warn $sftp->status();
}
print "I'm done - have a nice day.\n";
__END__
As you see, I have defined a custom "die" handler. For some reason,
when I run this script, I get three "die" messages from this handler,
even though the script successfully does the "put" and cleanly exits
with the polite message.
Why is Net::SFTP triggering my die handler when nothing seems to be
dying?
Thanks for any insights!
which illustrates my question:
#!/usr/bin/perl
use warnings; use strict;
use Net::SFTP;
local $SIG{__DIE__} = sub {
print "Oh no - I'm dead!\n";
};
my ( $host, $user, $password, $local_file, $remote_file ) =
qw{ myhost myname mypasswrd junk.txt junk2.txt };
if (my $sftp = Net::SFTP->new($host, (user => $user,
password => $password,)
)
) {
$sftp -> put ($local_file, $remote_file)
|| warn $sftp->status();
}
print "I'm done - have a nice day.\n";
__END__
As you see, I have defined a custom "die" handler. For some reason,
when I run this script, I get three "die" messages from this handler,
even though the script successfully does the "put" and cleanly exits
with the polite message.
Why is Net::SFTP triggering my die handler when nothing seems to be
dying?
Thanks for any insights!