Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^2: Nested runtime warning disabling

by kryten (Scribe)
on Jul 28, 2004 at 10:02 UTC ( #377980=note: print w/ replies, xml ) Need Help??


in reply to Re: Nested runtime warning disabling
in thread Nested runtime warning disabling

Thanks. I tried out Hook::LexWrap

use Hook::LexWrap; sub test_warnings { my $lexical = wrap 'GenerateWarning', pre => sub { no warnings }; GenerateWarning(); AnotherSub(); }
This does produce the result I was looking for, but I agree it is a little hackish.

Does anyone have a more elegant solution?


Comment on Re^2: Nested runtime warning disabling
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (23)
As of 2015-07-30 13:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (271 votes), past polls