Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Launching an external command from Perl in Linux

by kennethk (Abbot)
on May 05, 2009 at 15:55 UTC ( [id://761973]=note: print w/replies, xml ) Need Help??


in reply to Launching an external command from Perl in Linux

As the system documentation states, you should be passing a list of strings, not barewords as you've done.

As well, I note that you are assigning the return value from system. From what you've named your variable, I don't think it returns what you think it does. From the documentation:

The return value is the exit status of the program as returned by the wait call. To get the actual exit value, shift right by eight (see below). See also "exec". This is not what you want to use to capture the output from a command, for that you should use merely backticks or qx//, as described in "`STRING`" in perlop. Return value of -1 indicates a failure to start the program or an error of the wait(2) system call (inspect $! for the reason).
  • Comment on Re: Launching an external command from Perl in Linux

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://761973]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (3)
As of 2024-04-25 09:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found