use IPC::Run3; my ( @out, @err ); run3 [ $command ], undef, \@out, \@err; print map { "STDOUT = $_" } @out; print map { "STDERR = $_" } @err;