<?xml version="1.0" encoding="windows-1252"?>
<node id="542845" title="Re: WHy error message is printed in STDOUT?" created="2006-04-12 10:05:05" updated="2006-04-12 06:05:05">
<type id="11">
note</type>
<author id="33341">
Albannach</author>
<data>
<field name="doctext">
Just to combine the above [id://542838|correct] [id://542837|answers] into a working solution which does work under Windows (I used &lt;code&gt;del&lt;/code&gt; for simplicity but the effect is the same):
&lt;code&gt;
$cmd = 'del nonexistent.file'; 
chomp($res = `$cmd 2&gt;&amp;1`);
print "\n[Command is :: ", $cmd, "]\n[RESULT:: ", $res,"]\n\n";
&lt;/code&gt;&lt;p&gt;
Which prints:
&lt;code&gt;
[Command is :: del nonexistent.file]
[RESULT:: Could Not Find C:\My Documents\foo\Perl\dl\debug\nonexistent.file]&lt;/code&gt;
&lt;!-- Node text goes above. Div tags should contain sig only --&gt;
&lt;div class="pmsig"&gt;&lt;div class="pmsig-33341"&gt;
&lt;p&gt;--&lt;br&gt;
I'd like to be able to assign to an luser
&lt;/div&gt;&lt;/div&gt;</field>
<field name="root_node">
542812</field>
<field name="parent_node">
542812</field>
</data>
</node>
