Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Seeking the right way to override global variables

by LanX (Saint)
on Sep 26, 2014 at 14:00 UTC ( [id://1102136]=note: print w/replies, xml ) Need Help??


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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1102136]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (4)
As of 2024-04-24 05:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found