|
|
| more useful options | |
| PerlMonks |
Re: Unable to grab STDERR from a backtick commandby tbartold (Initiate) |
| on Oct 29, 2010 at 18:08 UTC ( [id://868374]=note: print w/replies, xml ) | Need Help?? |
|
I have the same problem with perl 5.10.1 under linux, but not with the original code, that works:
However, I want to trap an error from a simple command, but a bad one. For example, a misspelled command: my $cmd = "hostnam";Here I can't trap the error:
The odd thing is that if I redirect STDOUT/STDERR to a file instead, the error is redirected as expected.
Is there a better way to get the expected behavior without resorting to a file?
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||||||