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

Answer: How to run a shell script from a Perl program?

by DeadPoet (Scribe)
on Jan 08, 2011 at 17:32 UTC ( #881245=categorized answer: print w/replies, xml ) Need Help??

Q&A > programs and processes > How to run a shell script from a Perl program? - Answer contributed by DeadPoet

If you want the PID, STDOUT, and STDERR, use IPC::Open3.

Example:

use IPC::Open3; local (*IN, *OUT, *ERR); my $pid = eval{ open3( \*IN, \*OUT, \*ERR, 'my_command', 'my_command_args' ); }; if ($@) { warn ($@); } ## capture your output, if needed... ## wait on the pid... wait( $pid, 0 );

Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
NodeReaper waits for the new pizza guy, again

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (5)
As of 2018-01-19 00:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How did you see in the new year?










    Results (215 votes). Check out past polls.

    Notices?