Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: capturing stderr of echo piped to a file

by boftx (Deacon)
on Oct 29, 2014 at 18:55 UTC ( #1105529=note: print w/replies, xml ) Need Help??


in reply to capturing stderr of echo piped to a file

Here is how I've done it in test files:

# Capture any STDERR output my $stderr = ''; local *STDERR; open STDERR, '>', \$stderr;
I can't remember where I first saw that, but I've kept it handy ever since.

You must always remember that the primary goal is to drain the swamp even when you are hip-deep in alligators.

Replies are listed 'Best First'.
Re^2: capturing stderr of echo piped to a file
by Anonymous Monk on Oct 29, 2014 at 23:52 UTC
    That isn't as portable/reliable as Capture::Tiny, there are many such modules ... Capture::Tiny got created pretty late in the game but its the best of the best

      Agreed. I was simply showing a way to do it that I found handy back before then in response to the stated desire to avoid extra modules. I'm not even sure it would work in the situation given, but might be worth looking at.

      You must always remember that the primary goal is to drain the swamp even when you are hip-deep in alligators.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (2)
As of 2022-12-10 03:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?