in reply to Re^2: capturing command output
in thread capturing command output
If you call via perl backticks then only "hello" is captured, and "world" is still sent to stdout.I cannot reproduce that.
Or are you suggesting the OP would run a different command in backticks than in his open? Why would he do that?$ cat foo #!/usr/bin/perl print STDOUT "hello\n"; print STDERR "world\n"; $ cat bar #!/usr/bin/perl use 5.010; my $output = `./foo 2>&1`; say "[[$output]]"; $ chmod +x foo $ chmod +x bar $ ./bar [[world hello ]] $
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: capturing command output
by chrestomanci (Priest) on Jan 25, 2012 at 16:35 UTC | |
by JavaFan (Canon) on Jan 25, 2012 at 16:51 UTC |