in reply to Parsing and scoring an Array of Arrays

My guess is this code:
while (@{$self->{_score}[$i][$base]} ne "0") { $last = $base; $base++; }
How many items are in the array at $i? Your code never checks. It keeps incrementing $base. Eventually, it's going to run out of items, and Perl will happily attempt to oblige you by autovivifying a new array entry at the new position. It won't be an array reference, though, and there's your error.

As a side note, be careful with your comparisons. You almost certainly don't want to say if ($x = 1) {...

Replies are listed 'Best First'.
Re (tilly) 2: Parsing and scoring an Array of Arrays
by tilly (Archbishop) on Aug 09, 2001 at 09:07 UTC
    ObRandomTip: To avoid making the mistake:
    if ($x = 1) { # etc }
    get into the habit of trying to put the variables on the right, not the left. It looks strange, but:
    if (1 = $x) { # etc }
    is likely to give you a much more informative error message. (This habit will serve you in good stead in quite a few languages, not just Perl.)
Re: Re: Parsing and scoring an Array of Arrays
by mr_dont (Beadle) on Aug 09, 2001 at 04:16 UTC
    Chromatic, I think that you are right...
    Thanks,

    Mr. Don't!