Melly has asked for the wisdom of the Perl Monks concerning the following question:
Hi Monkeys,
To get the column names, I can write:
$output[0] = [ @{ $sql->{NAME} } ];
But to fetch the data, I have to write:
while(@temp_array = $sql->fetchrow_array ){ $output[$i] = [ @temp_array ]; $i++; }
Why can't I get away with (or similiar):
$i++ while $output[$i] = [ $sql->fetchrow_array ];
AFAIK I've tried all the variants I can think of, but I only get an error
Tom Melly, tom@tomandlu.co.uk
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: DBI and fetching data
by cchampion (Curate) on Sep 12, 2003 at 09:19 UTC | |
by Melly (Chaplain) on Sep 12, 2003 at 09:33 UTC | |
|
Re: DBI and fetching data
by Abigail-II (Bishop) on Sep 12, 2003 at 09:03 UTC | |
by Melly (Chaplain) on Sep 12, 2003 at 09:09 UTC | |
by cchampion (Curate) on Sep 12, 2003 at 09:32 UTC |