Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much

Re: WHy error message is printed in STDOUT?

by Albannach (Prior)
on Apr 12, 2006 at 14:05 UTC ( #542845=note: print w/ replies, xml ) Need Help??

in reply to WHy error message is printed in STDOUT?

Just to combine the above correct answers into a working solution which does work under Windows (I used del for simplicity but the effect is the same):

$cmd = 'del nonexistent.file'; chomp($res = `$cmd 2>&1`); print "\n[Command is :: ", $cmd, "]\n[RESULT:: ", $res,"]\n\n";

Which prints:

[Command is :: del nonexistent.file] [RESULT:: Could Not Find C:\My Documents\foo\Perl\dl\debug\nonexistent +.file]

I'd like to be able to assign to an luser

Comment on Re: WHy error message is printed in STDOUT?
Select or Download Code

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://542845]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (7)
As of 2015-11-25 08:36 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (672 votes), past polls