http://www.perlmonks.org?node_id=454744


in reply to Re: Capturing both STDOUT, STDERR and exit status
in thread Capturing both STDOUT, STDERR and exit status

Thanks, this is nice and clean. I did make the qx output scalar, otherwise it gives me a list of output lines.

sub executeCommand { my $command = join ' ', @_; ($? >> 8, $_ = qx{$command 2>&1}); } my ($status, $output) = executeCommand ('/bin/ls', '/');



pbeckingham - typist, perishable vertebrate.