in reply to capture STDERR from within code?

Using super search (catch STDERR), I've turned up this relevant gem: Reassign STDOUT/STDERR contents to a variable.

Replies are listed 'Best First'.
Re^2: capture STDERR from within code?
by leocharre (Priest) on Nov 10, 2009 at 14:45 UTC
    close(STDERR); open(STDERR, '>', \my $BUF) or die $!; warn "hey there"; $BUF=~/hey there/ or die;
    Yes! You rawk, thank you.