Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Calling external commands through my script

by kennethk (Monsignor)
on Feb 25, 2014 at 00:36 UTC ( #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.


Comment on Re: Calling external commands through my script
Download Code
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
Node Status?
node history
Node Type: note [id://1076063]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (9)
As of 2014-09-22 06:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (182 votes), past polls