open(my $pipe,'-|','/usr/local/bin/foo','bar','baz','1&2>3') or die "Can't start foo: $!"; my @output=<$pipe>; close $pipe or die "Broken pipe: $!";