Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number

help needede in backticks(``) and system function

by uva (Sexton)
on Feb 10, 2006 at 06:18 UTC ( #529288=perlquestion: print w/replies, xml ) Need Help??
uva has asked for the wisdom of the Perl Monks concerning the following question:

hello monks, what the difference between executing the external command in the system functionand the backticks operator. Is it correct ]system function] interpret the parent program and other one not.?
  • Comment on help needede in backticks(``) and system function

Replies are listed 'Best First'.
Re: help needede in backticks(``) and system function
by ikegami (Pope) on Feb 10, 2006 at 06:34 UTC

    The difference is whether the output (STDOUT) is captured or now. Backticks return what was printed to STDOUT, while system does not.

    From the docs, it sounds like backticks always pass the command to a subshell, while it's possible to avoid running a subshell with system.

      thanks ikegami.... will both the execution will interrupt the paren.i mean, will parent program wait until the child completes execution.

        Yes, the parent will wait in both cases. Unless you do execute something like command & (unix) or start command (Windows).

        fork+exec doesn't wait.
        IPC::Open3 doesn't wait.
        IPC::Run can do both.
        The special syntax system 1, ... in Windows doesn't wait.

Re: help needede in backticks(``) and system function
by planetscape (Chancellor) on Feb 10, 2006 at 07:39 UTC

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://529288]
Approved by ikegami
[LanX]: shmem: ah I see ... you'll need to check if the monastery standard classes come with border ... like the nodelets should
[karlgoethebier]: shmem: you could have linked to jackass as well ;-)
[stonecolddevin]: morning all
[shmem]: karlgoethebier: better choice, done. :-)

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (11)
As of 2017-07-24 17:01 GMT
Find Nodes?
    Voting Booth?
    I came, I saw, I ...

    Results (356 votes). Check out past polls.