Sorry. Computer says no. Does not compute.
Maybe try backtics
$output = `perl 2.pl`; if ($output =~ m/some random error message/) { die "Computer says no"; }
Alternatively look up do and wrap that in an eval. This is archaic but is probably what you want.
eval{ do '2.pl' }; die "Aaaagh! $@" if $@;
In reply to Re^3: system command
by tachyon-II
in thread system command
by palette
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |