in reply to Re^6: $1 not "freezing" in an addition
in thread $1 not "freezing" in an addition

PPI won't descend into functions or methods

Doesn't stop perlcritic from doing the descending, or running B::Xref

and can't descend into XS

descending into XS is not insurmountable either

You can only get so far with static analysis when trying to find all modifications of a global variable at or below your current call site.

You can well get pretty far I tell you what

who says we have to find them all? or even descend? or even all globals?

I see no use case for relying on the behaviour we see here , so IMHO it seems like a very safe low level warning for every  $global ... func to be turned into  "$global" ... func, esp for $1

Replies are listed 'Best First'.
Re^8: $1 not "freezing" in an addition
by chromatic (Archbishop) on Dec 15, 2012 at 20:25 UTC
    Doesn't stop perlcritic from doing the descending, or running B::Xref

    How is P::C to descend into code that's not loaded until runtime?

    descending into XS is not insurmountable either

    How is P::C to descend into compiled code that's not loaded until runtime and for which the source code is not available?

    IMHO it seems like a very safe low level warning for every $global ... func to be turned into "$global" ... func , esp for $1

    How do you know you've caught every global? How do you know stringification is desirable?

      How is P::C to descend into code that's not loaded until runtime?

      It could, wait for it, load the code

      do the scandeps dance

      not do anything at all

       

      How is P::C to descend into compiled code that's not loaded until runtime and for which the source code is not available?

      Who said P::C is supposed to do it ?

      How do you know you've caught every global? How do you know stringification is desirable?

      Clearly stringification of $1 is undesireable -- I am humbled by your logic

        If your answer to "How is Perl::Critic to do this thing?" is "Magic", then I'd very much like to see your implementation.

        Clearly stringification of $1 is undesireable...

        Giving the wrong answer sometimes is undesirable. Giving the wrong warning doubly so.