in reply to declaring arrays dynamically

Sounds like you want an Arrary of Arrays here. Pseudo Code:
my $sth1 = $dbh->prepare($full_query); $sth1->execute(); my @data_aoa = []; while (@data = $sth1->fetchrow_array()) { push @data_aoa[0], $data[0]; push @data_aoa[1], $data[1]; push @data_aoa[2], $data[2]; } . . . $sth1->fini

----
I Go Back to Sleep, Now.

OGB

Replies are listed 'Best First'.
Re^2: declaring arrays dynamically
by ikegami (Patriarch) on Sep 14, 2004 at 18:35 UTC

    Why use pseudocode which is only a few chars different than the real code?

    my $sth1 = $dbh->prepare($full_query); $sth1->execute(); my @data_aoa; while (@data = $sth1->fetchrow_array()) { push @{$data_aoa[0]}, $data[0]; push @{$data_aoa[1]}, $data[1]; push @{$data_aoa[2]}, $data[2]; } $sth1->finish()