in reply to Re: system commandin thread system command
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"; } [download]
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 $@; [download]