Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Thanks!use DBI; my @tables = qw(name car pet); my @name, @car, @pet; sub fill_array() { $sql = "select * from $i;"; $dbh = DBI->connect($dsn, $dbuser, $dbupass) || die "Connection failed: $!\n"; $sth = $dbh->prepare( "$lsql;" ) || die "Couldn't prepare: $!\n"; $sth->execute(); while ( my @row = $sth->fetchrow_array ) { #Here's my problem :( <@(right_array)> = (<@(right_array)>, row[1]); } $rc = $dbh->disconnect || die "Disconnect Failed: $!\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Fill Arbitrary Array
by tadman (Prior) on May 02, 2002 at 08:24 UTC | |
by Anonymous Monk on May 02, 2002 at 13:55 UTC | |
by tadman (Prior) on May 02, 2002 at 17:22 UTC | |
by Anonymous Monk on May 02, 2002 at 09:53 UTC |