my $exit2 = system "program2", $exit1; if ($exit2 == -1) { die "Failed to call 'program2': $!\n"; }