Do you know where your variables are? | |
PerlMonks |
Re^3: Perl Style: Is initializing variables considered taboo?by BrowserUk (Patriarch) |
on Aug 21, 2010 at 16:53 UTC ( [id://856481]=note: print w/replies, xml ) | Need Help?? |
Of course I use strictures in all my code! I did say "if". Not everybody uses strict; and I don't know you from the next guy; so there is no "of course" about it. Why else would I be asking about variable initialization if I did not predeclare them?Because initialising/reinitialising your variable to undef becomes very important if you don't use my, because globals have this habit of retaining their values from previous iterations of loops, and previous calls to subroutines. As for style, that is in the eye of the beholder. I find much perlstyle a total anathema; often supported by nothing more than justifictions. Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
In Section
Seekers of Perl Wisdom
|
|