reasonablekeith has asked for the wisdom of the Perl Monks concerning the following question:
As per the title, I can't seem to get STDERR into the result from a backtick command. Case in point...
I did compile perl myself, is it possible I messed it up? Any pointers appreciated, Ta, Rob#!/local/home/myuser/projects/installs/perl5.10.1/bin/perl my $cmd = "echddo 'arghh'"; my $cmd_result = `$cmd 2>&1`; my $cmd_rc = $?; print "CMD : >>$cmd<<\n"; print "RETURN_CODE: >>$cmd_rc<<\n"; print "CMD_RESULT : >>$cmd_result<<\n"; ------- Which when run gives... myuser@myserver./exec_test.pl sh: echddo: not found CMD : >>echddo 'arghh'<< RETURN_CODE: >>256<< CMD_RESULT : >><<
Back to
Seekers of Perl Wisdom