G'day Raymond,
On Fri Jan 23 03:20:04 2009, rwan@kuicr.kyoto-u.ac.jp wrote:
Show quoted text> I found a few typos in the on-line (HTML) documentation. The first is
> minor; I may be wrong about the others since it could be that I am
> misunderstanding the commands that end in -x.
Thank-you very much for the bug report! It's very much appreciated.
Show quoted text> 1) The section "Advanced Usage" has "Advanced" spelled wrong.
Oops, this is quite embarrassing. It's now fixed in my code repository[1].
Show quoted text> 2) In the first box of commands under "Advanced Usage", I think the
> second "run" should be "runx"?
> 3) In the fourth box of commands also under "Advanced Usage", I think
> both "capture"'s should be "capturex"?
The only difference between run/capture and their corresponding -x forms
is what they do when passed a single argument. When called with
multiple arguments, both run() and capture() (and runx() and capturex()
) will avoid the shell. When called with a single argument, run() and
capture() may use the shell, whereas runx() and capturex() will not.
As such, the examples in the documentation do really work as they are
documented. Since they're being called with multiple arguments, they're
equivalent to using runx() or capturex():
run("cat","/etc/motd"); # Execute command without shell
# Capture text while avoiding the shell.
my $file = capture("cat", "/etc/motd");
my @lines = capture("cat", "/etc/passwd");
The main use for runx/capturex/systemx is when calling them with a
single argument, or with a command with an argument list that may be emtpy:
runx($cmd); # Never uses the shell.
runx($cmd, @args); # Never uses the shell, even if @args = ();
If you think there's a better way that I can explain this in the
documentation, then I'd appreciate any suggestions you may have.
All the very best,
Paul
[1]
https://github.com/pfenwick/ipc-system-simple/