Re: Why does Net::SFTP trigger my die handler when no errors?
- From: "A. Sinan Unur" <1usa@xxxxxxxxxxxxxxxxxxx>
- Date: Tue, 31 Jan 2006 16:15:18 GMT
xhoster@xxxxxxxxx wrote in news:20060131110941.189$k3@xxxxxxxxxxxxxx:
> usenet@xxxxxxxxxxxxxxx wrote:
>> 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";
>> };
>
> I think it would be nice, at least for debugging purposes, if you had
> your sub print out the error message it was called with. Then you
> would know what it was.
Yeah ... I did it the long hard way ... It was dying in a bunch of
evals.
> However, from perldoc perlvar:
>
> Due to an implementation glitch, the $SIG{__DIE__} hook
> is called even inside an eval(). Do not use this to
> rewrite a pending exception in $@, or as a bizarre
> substitute for over- riding CORE::GLOBAL::die(). This
> strange action at a distance may be fixed in a future
> release so that $SIG{__DIE__} is only called if your
> program is about to exit, as was the original intent.
> Any other use is deprecated.
Oooops ... I missed that and I wasted a lot of time.
> So it would be my guess that Net::SFTP is dying from inside an eval,
That is true. In wasting my time on this, I realized that David's script
does not actually work on my machine because Net::SSH::Perl dies:
> Net::SSH::Perl::_connect(C:/opt/Perl/site/lib/Net/SSH/Perl.pm:212):
> 212: defined($sock->blocking(0))
> 213: or die "Can't set socket non-blocking: $!";
> DB<17> s
> main::CODE(0x182e1cc)(sftp.pl:6): print "Oh no - I'm dead!\n";
> DB<17> s
> Oh no - I'm dead!
> Can't set socket non-blocking: Bad file descriptor at
> C:/opt/Perl/site/lib/Net/SSH/Perl.pm line 212, <GEN0> line 1.
This is listed as a resolved bug at
http://rt.cpan.org/Public/Bug/Display.html?id=17127
I hate to repeat myself, but I am kind of puzzled. I don't need SFTP
anytime soon, but does anyone know what the resolution is?
Sinan
--
A. Sinan Unur <1usa@xxxxxxxxxxxxxxxxxxx>
(reverse each component and remove .invalid for email address)
comp.lang.perl.misc guidelines on the WWW:
http://mail.augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html
.
- References:
- Prev by Date: Re: Why does Net::SFTP trigger my die handler when no errors?
- Next by Date: print statement creates key in hash with reference to empty array??
- Previous by thread: Re: Why does Net::SFTP trigger my die handler when no errors?
- Next by thread: Re: Why does Net::SFTP trigger my die handler when no errors?
- Index(es):