Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: Re: Re: Running System Commans With ""

by jkahn (Friar)
on Sep 11, 2002 at 20:26 UTC ( #197067=note: print w/replies, xml ) Need Help??


in reply to Re: Re: Running System Commans With ""
in thread Running System Commands With ""

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.

If you do want shell-style redirection, though, you'll have to use a system EXPR syntax. It's not all bad; a number of Perl Cookbook recipes use it for good reason (mostly for shell redirection).

Replies are listed 'Best First'.
•Re: Re: Re: Re: Running System Commans With ""
by merlyn (Sage) on Sep 12, 2002 at 17:04 UTC
    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

    system "sleep 5"; system "sleep 5;"; # notice the semicolon
    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.

    -- Randal L. Schwartz, Perl hacker

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://197067]
help
Chatterbox?
[Corion]: marto: Naah, the main thing I'm unhappy about is that I'm angry about that situation at all instead of mostly ignoring it and rejecting/closing the incidents.
[Corion]: (well, and angry about the actors there, while I should simply ignore them)
[marto]: LanX++ asking the right questions :)
[Corion]: And I also have to talk to the technician implementing the export side of the change that this is not about them, and that maybe they should hold on to that changeset just in case the project comes back with a formally correct approach...
[Corion]: Naah - I think the "fasta" format should be familiar by now to the casual visitor of this site ;)
[Corion]: The rest would benefit from de-jargonizing. Maybe somebody versed in both, Perl and bioinformatics could write up a translation dictionary ;)
[marto]: I helped with some corrections to the Glasgow Uni Perl for Bioinformatics course, but didn't get time to do a full review. I've also patched some trivial problems with the bioperl based upon a question someone asked here.
[marto]: but I've never done any bioinformatics work, so don't know what people are talking about :P
[marto]: Corion biohisham & BioLion seem long gone

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (8)
As of 2017-08-17 09:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Who is your favorite scientist and why?



























    Results (285 votes). Check out past polls.

    Notices?