in reply to Re: capturing command output
in thread capturing command output
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:
#!/usr/bin/perl print STDOUT "hello\n"; print STDERR "world\n";
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.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: capturing command output
by JavaFan (Canon) on Jan 25, 2012 at 15:54 UTC | |
by chrestomanci (Priest) on Jan 25, 2012 at 16:35 UTC | |
by JavaFan (Canon) on Jan 25, 2012 at 16:51 UTC |
In Section
Seekers of Perl Wisdom