Yes, it's faster because there's no need for an intermediate sh process to get loaded, parse the arguments, redirect input and output where they should be sent to, and pass the arguments to the program invoked.No, if there are no shell metachars, Perl does the splitting itself, so there's no sh process involved.
Convince yourself of this by executing an appropriate ps command during each of
Other arguments in favor of "avoid the sh at all costs" in this thread are still valid. Just wanted to point out that the single-arg system does not always call sh. It just might.system "sleep 5"; system "sleep 5;"; # notice the semicolon
-- Randal L. Schwartz, Perl hacker
In reply to •Re: Re: Re: Re: Running System Commans With ""
by merlyn
in thread Running System Commands With ""
by lostperls
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |