<?xml version="1.0" encoding="windows-1252"?>
<node id="881245" title="Answer: How to run a shell script from a Perl program?" created="2011-01-08 12:32:54" updated="2011-01-08 12:32:54">
<type id="1888">
categorized answer</type>
<author id="11732">
QandAEditors</author>
<data>
<field name="doctext">
&lt;p&gt;If you want the PID, STDOUT, and STDERR, use [mod://IPC::Open3].&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Example:&lt;/b&gt;&lt;/p&gt;

&lt;code&gt;
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 );
&lt;/code&gt;

</field>
<field name="parent_node">
78523</field>
</data>
</node>
