llancet has asked for the wisdom of the Perl Monks concerning the following question:
my $result = `blastall -i foo -o bar -p blastx -d baz`; if ($!) { die "something bad happened: $!"; }
However, the program always die, even if blastall seems to be working properly. It seems that $! only stores something stderr, but not always critical.
So, how should I get the return value properly? Should I use:
instead?eval { $result = `......`; } if ($@) { die "......"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Capture external program return value
by ikegami (Patriarch) on May 02, 2010 at 01:54 UTC | |
by JavaFan (Canon) on May 02, 2010 at 09:03 UTC | |
by ikegami (Patriarch) on May 02, 2010 at 16:44 UTC | |
by Anonymous Monk on May 02, 2010 at 16:51 UTC | |
by ikegami (Patriarch) on May 02, 2010 at 20:28 UTC | |
|
Re: Capture external program return value
by tokpela (Chaplain) on May 02, 2010 at 04:05 UTC | |
by Hue-Bond (Priest) on May 02, 2010 at 08:23 UTC | |
|
Re: Capture external program return value
by doug (Pilgrim) on May 02, 2010 at 14:52 UTC |