#!/usr/bin/perl use strict; use warnings; use IPC::Open3; my $input; my $pid = open3( $input, \*OUT, \*ERROR, "./foo.pl" ); waitpid( $pid, 0 ); my $rc = $? >> 8; print "Rc=$rc\n";