in reply to Seeking the right way to override global variables

Already the first question is almost tl;dr plz consider different posts next time.

You should use local only within the target scope, but your applying it before use, which is problematic.

Module code outside subs is executed, that's why the effect of local is negated again.

Cheers Rolf

(addicted to the Perl Programming Language and ☆☆☆☆ :)

  • Comment on Re: Seeking the right way to override global variables

Replies are listed 'Best First'.
Re^2: Seeking the right way to override global variables
by contra-sh (Acolyte) on Sep 26, 2014 at 15:12 UTC

    Yes but the target scope is not aware that we are in "unit test mode"...

    Thank you for the answer.