my $output = `batch_file args`; die "Gone horribly wrong - $?" if $?; # or ... my @output = `batch_file args`; die "Gone horribly wrong - $?" if $?;