in reply to Populating Arrays of Arrays

You have:

#this line is problematic @$scalarclose[$count]=map {$_}, @ctagarray;
I'm zeroing in on this. What you probably want is:
@$scalarclose[$count]=[map {$_}, @ctagarray];
An array can only hold a scalar, even if that scalar is actually a ref to something else. In this case, I've made the scalar into a ref to an anonymous array.

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.

Replies are listed 'Best First'.
Re^2: Populating Arrays of Arrays
by husker (Chaplain) on Mar 03, 2005 at 19:59 UTC
    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).

      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.