in reply to Re^2: Disabling runtime warnings in dynamic scope? (no warnings 'exiting'; use warnings 'exiting';
in thread Disabling runtime warnings in dynamic scope?

PadWalker?

update: PadWalker is a bust, peek_sub and peek_our didn't return WARNING_BITS.

But Scope::Context looks like a candidate

update: another candidate Devel::Declare

  • Comment on Re^3: Disabling runtime warnings in dynamic scope? (Scope::Context)

Replies are listed 'Best First'.
Re^4: Disabling runtime warnings in dynamic scope? (Devel::Declare)
by LanX (Saint) on Apr 26, 2018 at 00:06 UTC
Re^4: Disabling runtime warnings in dynamic scope? (Scope::Context)
by LanX (Saint) on Apr 25, 2018 at 23:37 UTC
    > Scope::Context

    Thanks, interesting! :)

    Seems to be based on Scope::Upper and does loads of black magic. (And might be useful to implement lisp style macros)

    But only on upper contexts. The subs in questions are "lower" contexts

    Cheers Rolf
    (addicted to the Perl Programming Language and ☆☆☆☆ :)
    Wikisyntax for the Monastery

      Magicky indeed, another one

      Code::Splice - Injects the contents of one subroutine at a specified point elsewhere.

      based on B::Generate - Create your own op trees.

        Dark than dark magic, and P5P will abandon any hope of progress.

        This is really interesting though.

        But I think you missed the part where I asked for a "cleaner solution" ;)

        Cheers Rolf
        (addicted to the Perl Programming Language and ☆☆☆☆ :)
        Wikisyntax for the Monastery

Re^4: Disabling runtime warnings in dynamic scope? (PadWalker)
by LanX (Saint) on Apr 25, 2018 at 23:25 UTC
    I'm pretty sure PadWalker can't access global special vars inside a foreign sub.

    And manipulating the warn handler looks cleaner now (though I have to check caller(2) too)

    Cheers Rolf
    (addicted to the Perl Programming Language and ☆☆☆☆ :)
    Wikisyntax for the Monastery