<?xml version="1.0" encoding="windows-1252"?>
<node id="274927" title="Re: Re: Use of IPC::Run rather than system()" created="2003-07-16 12:50:07" updated="2005-06-08 19:45:00">
<type id="11">
note</type>
<author id="127307">
IlyaM</author>
<data>
<field name="doctext">
&lt;p&gt;It doesn't help if you want to capture STDERR and STDOUT in &lt;i&gt;separate&lt;/i&gt; scalars.&lt;/p&gt;
&lt;p&gt;To answer [gmarler]'s question: if you just want to capture STDERR and STDOUT for an external program then it is rather easy to do with [cpan://IPC::Run]:&lt;/p&gt;
&lt;code&gt;
use IPC::Run qw(run);

my($out, $err);
run ['/path/to/prog', 'arg1', 'arg2'], '&gt;', \$out, '2&gt;', \$err;
&lt;/code&gt;
&lt;p&gt;You can find more complex examples in following nodes:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;[id://206655]
&lt;li&gt;[id://212521]
&lt;li&gt;[id://268889]
&lt;/ul&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">
274915</field>
</data>
</node>
