in reply to Nested runtime warning disabling

Hackish, but you could use Hook::LexWrap to surround your GenerateWarning() with a wrapper that does no warnings;.

Replies are listed 'Best First'.
Re^2: Nested runtime warning disabling
by kryten (Scribe) on Jul 28, 2004 at 10:02 UTC
    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?