Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re^2: Saving STDERR and displaying it later

by UnwashedCat (Acolyte)
on Jul 03, 2006 at 18:19 UTC ( #559033=note: print w/ replies, xml ) Need Help??


in reply to Re: Saving STDERR and displaying it later
in thread Saving STDERR and displaying it later

Hey, this is exactly what I wanted! I'll have to remember to search CPAN more thoroughly next time. Thanks!


Comment on Re^2: Saving STDERR and displaying it later
Re^3: Saving STDERR and displaying it later
by leriksen (Curate) on Jul 03, 2006 at 23:43 UTC
    If you dont want to introduce a dependency on IO::Capture::Stderr, and you only want to capture the STDERR from the die() calls, you could try this

    my @dieings; sub my_die() { # localise capture to just my_die() calls... local $SIG{__DIE__} = sub { push(@dieings, @_); }; die(@_); } #... time passes my_die("now we need to capture"); #... time passes print "now we need to report " . Dumper(\@dieings);

    It may be possible to replace die() with this at compile time, I've never tried the *CORE::GLOBAL trick with die(), only open(). I know there are some perl functions where not even compile-time replacement works, die() might be one of those.

    ...reality must take precedence over public relations, for nature cannot be fooled. - R P Feynmann

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (6)
As of 2014-08-29 05:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (275 votes), past polls