Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

Re: Re: Re: Best Way to Redirect STDERR to a Scalar

by davido (Archbishop)
on Sep 14, 2003 at 01:06 UTC ( #291325=note: print w/replies, xml ) Need Help??

in reply to Re: Re: Best Way to Redirect STDERR to a Scalar
in thread Best Way to Redirect STDERR to a Scalar

I don't know that it's correct or safe to jump to the conclusion that Tie::STDERR won't do what's needed, as the OP didn't specify in his original post that he was trying to catch errors that come from executing external commands.

Tie::STDERR will allow you to redirect any errors that come from Perl or Perl commands, but not from external (such as system() or `` backticks). It will even catch Perl's compiler errors, though as the POD states, the errors that it reports from the compiler aren't what you might expect to see.

So if you're trying to redirect the output from any Perl-generated errors, or errors that you generate internally in your script, Tie::STDOUT works great. But if you want to redirect external command errors, you'll have to dig deeper.


"If I had my life to do over again, I'd be a plumber." -- Albert Einstein

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://291325]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (4)
As of 2018-06-19 16:36 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (114 votes). Check out past polls.