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

How to Run the Executables in perl

by vr786 (Sexton)
on Nov 04, 2010 at 09:21 UTC ( [id://869417]=perlquestion: print w/replies, xml ) Need Help??

vr786 has asked for the wisdom of the Perl Monks concerning the following question:

Hi all,I am trying to execute the executables through the perl script , how can we run it.........

Replies are listed 'Best First'.
Re: How to Run the Executables in perl
by moritz (Cardinal) on Nov 04, 2010 at 09:28 UTC

      ... and by other means

      My favorite is IPC::System::Simple qw(capturex systemx). I know people are very wary of ::Simple modules, but that one is just great.

Re: How to Run the Executables in perl
by zentara (Archbishop) on Nov 04, 2010 at 12:20 UTC
    How you run it depends on what sort of output you need to collect.

    If you want the STDOUT and STDERR, plus the ability to write to STDIN , use something like IPC::Open2 or IPC::Open3.

    If you need to share data from the executable in realtime, with other parts of the script, threads might be useful.

    If you just need to run the executable without collecting returns from it, just use backticks, simple piped opens, etc.

    Finally, I see that many of your previous questions were Tk related, and in that regard, you must take precautions to NOT block the functioning of the Tk eventloop with your program execution. So with Tk, or most any gui, piped opens or IPC::Open3, or threads are used, to run the external command in a different time slice.


    I'm not really a human, but I play one on earth.
    Old Perl Programmer Haiku ................... flash japh
Re: How to Run the Executables in perl
by raybies (Chaplain) on Nov 04, 2010 at 11:56 UTC
    Is he asking how to execute a system call from within perl? Or another perl script within the perl script? Or simply how to run a perl script in general? Or maybe he needs to run the script down to his boss down on the other side of the building? See, this is what comes of asking questions that aren't specific enough. ;)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (6)
As of 2024-04-24 12:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found