in reply to Re: Populating Arrays of Arrays
in thread Populating Arrays of Arrays

Note that you have way too many declarations up front. Try moving the "my" closer to where each variable is first used. This is Perl, not Pascal. Thanks.

Is that really a big deal? I declare the same way (although I will group declarations together).

Replies are listed 'Best First'.
Re^3: Populating Arrays of Arrays
by Mugatu (Monk) on Mar 03, 2005 at 20:56 UTC
    Is that really a big deal?

    It's indicative of a weak understanding of lexical scope. It's a symptom of a problem, not a problem in and of itself. Putting a huge block of my declarations at the top of the file is not a whole lot better than using package variables for everything. About the only benefit you get from strict is checking for typos.

    I prefer to scope variables as tightly as possible. That means, at the latest possible time and smallest possible block for the code to still work. Then, not only do I get protection against typos in variable names, I also get protection against inadvertant action-at-a-distance.