in reply to Re: bad die behaviour?
in thread bad die behaviour?
then I use it in a script as in:sub FatalError { my $message = shift; my ($package, $filename, $line) = caller; Log "ERROR","$message ($filename linea $line)"; CloseLog; die "ERROR: $message ($filename linea $line)\n"; }
Result is the error message appears in the log but the script finishes with 0 return code. I have tried to force the return code with $! but with no positive result.$conn = Net::SFTP::Foreign::Compat->new($ftp_host,(user => $ftp_user)) +; if ( $conn->error ) { my $errormsg=$!; FatalError "Error: $errormsg"; }
Thanks Xavi
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: bad die behaviour?
by ikegami (Patriarch) on Sep 10, 2007 at 12:40 UTC | |
by Anonymous Monk on Sep 10, 2007 at 13:13 UTC | |
by ikegami (Patriarch) on Sep 10, 2007 at 13:26 UTC | |
by Anonymous Monk on Sep 10, 2007 at 13:38 UTC | |
by nimdokk (Vicar) on Sep 10, 2007 at 13:58 UTC | |
|
Re^3: bad die behaviour?
by bruceb3 (Pilgrim) on Sep 10, 2007 at 21:22 UTC |