Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: defining variables using my - subroutines

by GrandFather (Cardinal)
on Sep 05, 2012 at 23:49 UTC ( #991974=note: print w/ replies, xml ) Need Help??


in reply to defining variables using my - subroutines

You may care to reread Re: Calling a subroutine within a conditional which addresses exactly that issue. If there is stuff in that reply you don't understand, ask.

In general variables should be declared in the smallest scope that makes sense and most often initialised with their first sensible value when they are declared. Think about which parts of the code need to be able to access a variable and declare it so that only those parts can see it (but don't use global variables).

True laziness is hard work


Comment on Re: defining variables using my - subroutines

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (13)
As of 2014-09-18 18:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (120 votes), past polls