This does produce the result I was looking for, but I agree it is a little hackish.use Hook::LexWrap; sub test_warnings { my $lexical = wrap 'GenerateWarning', pre => sub { no warnings }; GenerateWarning(); AnotherSub(); }
Does anyone have a more elegant solution?
In reply to Re^2: Nested runtime warning disabling
by kryten
in thread Nested runtime warning disabling
by kryten
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |