Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Calling external commands through my script

by kennethk (Abbot)
on Feb 25, 2014 at 00:36 UTC ( [id://1076063]=note: print w/replies, xml ) Need Help??


in reply to Calling external commands through my script

How you should call them depends upon your needs. Do you need to process their inputs or outputs through Perl? Do you want the external call to be blocking? Do you want to implement time-outs? What OS are you on?

Options include:

and more. See perlipc for some important detail.


#11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.

Replies are listed 'Best First'.
Re^2: Calling external commands through my script
by Anonymous Monk on Feb 25, 2014 at 00:42 UTC
    It's actually that I want to call the program, which will run and then create a file that I will process. Everything is done on Linux OS. So you think <system> is OK to go, right?
      system is a good solution if the program should be blocking, you have no need to interact with STDIN/STDOUT/STDERR, and you don't need to worry about a timeout. Be aware that any STDOUT or STDERR the program generates will just get tacked onto your perl IO channels.

      I'd recommend using a list-based call to avoid escaping complications (e.g. system($executable, @args);) but again, that's generic advice.


      #11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (4)
As of 2024-03-28 21:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found