in reply to Global Symbol issue while using arrays
When you take the time to type (or cut/paste) the phrase, "use strict;", or as someone else pointed out, "use Modern::Perl;", you are asking for Perl to enforce a number of rules that aim to improve your code's quality. The first rule is no symbolic references. The second rule is declare your variables. And the most common way to do that is to declare lexical variables, with "my".
I would encourage you to not put anything in your scripts that you don't know what function is being served. On the other hand, I would encourage you to put use strict; in every one of your scripts. Now we have an apparent contradiction: Don't include things you don't know what they do, and do use strict always. How to resolve that dichotomy? Read strict, Private Variables via my, and use, in that order. ;)
And as pointed out earlier, Modern::Perl is superset to strict.
....and as someone is sure to point out, rules are sometimes made to be broken.
Dave
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Global Symbol issue while using arrays
by prasaduco (Initiate) on Jun 07, 2011 at 07:12 UTC | |
by davido (Cardinal) on Jun 07, 2011 at 07:20 UTC |