Perl Monk, Perl Meditation | |
PerlMonks |
Re^2: capturing command outputby chrestomanci (Priest) |
on Jan 25, 2012 at 13:52 UTC ( [id://949908]=note: print w/replies, xml ) | Need Help?? |
The OP's script captures both STDOUT and STDERR, but plain backticks will only capture STDOUT. As a demo, I used a script like this:
If you run it on a bash cmd line you get both lines of output as you would expect. If you call via perl backticks then only "hello" is captured, and "world" is still sent to stdout.
In Section
Seekers of Perl Wisdom
|
|