<?xml version="1.0" encoding="windows-1252"?>
<node id="274990" title="Re: Re^4: Use of IPC::Run rather than system()" created="2003-07-16 15:18:39" updated="2005-06-08 19:40:16">
<type id="11">
note</type>
<author id="127307">
IlyaM</author>
<data>
<field name="doctext">
Something like this should work:

&lt;code&gt;
use IPC::Run qw(run);

my ($out, $err) = ('', '');
run(['/path/to/prog', @args],
    '&gt;',  sub { $out .= $_[0]; print $_[0] },
    '2&gt;', sub { $err .= $_[0]; print $_[0] });
&lt;/code&gt;


&lt;p&gt;
&lt;font color="grey" size="-2"&gt;
--&lt;br&gt;
Ilya Martynov,  &lt;a href="mailto:ilya@iponweb.net"&gt;ilya@iponweb.net&lt;/a&gt;&lt;br&gt;
CTO IPonWEB (UK) Ltd&lt;br&gt;
Quality Perl Programming and Unix Support
UK managed @ offshore prices - &lt;a href="http://www.iponweb.net"&gt;http://www.iponweb.net&lt;/a&gt;&lt;br&gt;
Personal website - &lt;a href="http://martynov.org/"&gt;http://martynov.org&lt;/a&gt;&lt;br&gt;
&lt;/font&gt;</field>
<field name="root_node">
274875</field>
<field name="parent_node">
274975</field>
</data>
</node>
