in reply to Re: Maximum sub-arrays?
in thread Maximum sub-arrays?

Looking at your code:
my @dbData; while (@names = $day->fetchrow_array()) { $name = $names[0]; push my @virus, [@dbData]; }

Where did you initialize the values for @dbData? I suspect you wanted something like this instead:
my @virus = (); while (my @names = $day->fetchrow_array()) { push @virus, [ $name[0] ]; }

Replies are listed 'Best First'.
Re: Maximum sub-arrays?
by Anonymous Monk on Mar 01, 2004 at 12:12 UTC
    No, later in program (after all of the arrays have been created) the following is in a loop:
    push @{ dbData[$index] }, $somevalue;
    The  $name=$name[0] line is misleading and shouldn't have been included in my snippet.
      push @{ dbData[$index] }, $somevalue;

      Is that a typo or was that the source of your problem?

      push @{ $dbData[$index] }, $somevalue; # ^ # missing the $