http://www.perlmonks.org?node_id=1053772


in reply to Re: Loop that creates multidimensional array?
in thread Loop that creates multidimensional array?

got it to work with this:
while ($row = $sth->fetchrow_arrayref()) { @array = (@$row[0], @$row[4]); push @{ $players[$count] }, @array; }

Replies are listed 'Best First'.
Re^3: Loop that creates multidimensional array?
by fishmonger (Chaplain) on Sep 12, 2013 at 19:11 UTC

    No need to copy the 2 items to a new array.

    while (my $row = $sth->fetchrow_arrayref) { push @{ $players[$count] }, $row->[0], $row->[4]; }