Re: map array to hash
- From: john@xxxxxxxxxx (John Ackley)
- Date: Mon, 29 May 2006 11:38:38 -0400
Jenda Krynicky wrote:
From: John Ackley <john@xxxxxxxxxx>thanks! yes, I did not RTFM
there is more than one way to do it
is there an easier way to do this map:
my $index = 0;
while( my @a = $SQL->fetchrow_array) {
my %a = map { $fieldnames[$index++] => $_ } @a;
print "$_ => $a{$_}\n" for (keys %a);
}
Any reason why you are not using fetchrow_hashref()?
.
- Prev by Date: Re: year not returned by Time::localtime
- Next by Date: Re: accessor problem in OO
- Previous by thread: Re: map array to hash
- Next by thread: Capture Win32 events
- Index(es):