in reply to Re^5: Reading output of external program without Shell
in thread Reading output of external program without Shell
Hm, you're right, it does say that!
# Call this system's shell, returns TRUE on 0 exit code # THIS IS THE OPPOSITE SENSE OF system()'s RETURN VALUE run "cat a b c" or die "cat returned $?"; # Launch a sub process directly, no shell. Can't do redirection # with this form, it's here to behave like system() with an # inverted result. $r = run "cat a b c";
I don't see how run would know that it is being called as run() or die vs. $r = run(). Also, I can't get it to work...
$ perl -wMstrict -MIPC::Run=run -e' my $r = run "pstree -A $$" ' perl---sh---pstree
Later on the docs say:
run(), start(), and harness() can all take a harness specification as input. A harness specification is either a single string to be passed to the systems' shell
And, on the other hand, the IPC::Run docs don't explicitly say that run [...] doesn't use the shell, although in the code you can find exec { $_[0] } @_;. It's all a bit confusing unfortunately.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^7: Reading output of external program without Shell
by karlgoethebier (Abbot) on Nov 16, 2017 at 13:40 UTC |