in reply to Capture external program return value
eval won't help as it catches exceptions and backticks do not throw exceptions.
Backticks are documented to return undef on error, so what you need is
my $result = `blastall -i foo -o bar -p blastx -d baz`; die("Could not execute blastall: $!\n") if !defined($result);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Capture external program return value
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 |