# untested my @out; my $pid=open my $pipe, '-|'; defined $pid or croak "fork failed"; if ($pid==0) { exec $command, $opt1, $opt2, ..., '--', $arg1, $arg2, ... exit(0); } else { @out=<$pipe> }