Re: Why does Net::SFTP trigger my die handler when no errors?
- From: usenet@xxxxxxxxxxxxxxx
- Date: 31 Jan 2006 10:47:11 -0800
xhoster@xxxxxxxxx wrote:
> 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.
Do you mean $! ? I wasn't sure $! would be reliable here. I actually
included $! as I was trying to figure out what was going on, and I got
a bunch of (seemingly) meaningless messages.
> However, from perldoc perlvar:
> <snip perldoc>
> So it would be my guess that Net::SFTP is dying from inside an eval, as
> part of its normal course of business, and you are intercepting those dies.
I'm glad you were able to translate that perldoc statement (which I
struggle to understand, with little success) into something that makes
sense! Thanks!
>
> But this lead me to ask a broader question. What are you trying to do, and
> why are you using a SIG die handler, rather than eval{}, to do whatever it
> is you are tyring to do?
>
The die handler is designed to catch my own die() calls. I die within
my script under various dire circumstances, but I want to do some
housecleaning before I really leave (dispatching final logging methods,
closing databases cleanly, etc), so I use the handler. Maybe that's not
the best way to do it...
I didn't anticipate catching any die()s from Net::SFTP because the docs
for the module claim it die()s only in under fairly restrictive (and
unlikely) conditions. Your speculation about the module die()'ng inside
evals sounds plausable, and will make me re-think my exit strategy for
exception handling.
Thanks, Xho (and thanks, Sinan, for your amazing efforts to help also,
which were apparently thwarted by what seems to be a bug in Net::SSH on
Windows - but I'm a UN*X weenie).
--
http://DavidFilmer.com
.
- Follow-Ups:
- References:
- Prev by Date: Re: Transform hash key?
- Next by Date: Re: 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):
Relevant Pages
|