Come for the quick hacks, stay for the epiphanies. | |
PerlMonks |
Re: Prevent my STDERR logging in evals...by mscharrer (Hermit) |
on May 07, 2008 at 21:25 UTC ( [id://685333]=note: print w/replies, xml ) | Need Help?? |
Just a guess: Did you tried to set $SIG{__WARN__} to an empty sub { } or to undef at the very beginning of the eval to catch the warnings?
Update: I thought now about a tiny test for this: Both have the warning still in $@. I can't say much about a tied STDERR but it looks pretty much that this isn't working. One another idea I had was to localise the STDERR typeglob inside eval: perl -e '$a=10; eval { local *STDERR; print STDERR "Test\n"; $a->isa('foo'); }; print $@;' While this still sets the warning inside $@ the message to STDERR isn't printed. It's worth a try.
In Section
Seekers of Perl Wisdom
|
|