Getting STDOUT, STDERR, and response code from external *nix command in perl
问题 I want to execute an external command from within my Perl script, putting the output of both stdout and stderr into a $variable of my choice, and to get the command\'s exit code into the $? variable. I went through solutions in perlfaq8 and their forums, but they\'re not working for me. The strange thing is that I don\'t get the output of sdterr in any case, as long as the exit code is correct. I\'m using Perl version 5.8.8, on Red Hat Linux 5. Here\'s an example of what I\'m trying: my $cmd=