in reply to Re^2: building a hash from a database
in thread building a hash from a database
What do you mean by symbolic reference to a new hash?Well, first of all, you're setting the value of $hash{$id} to, say, 1. And then you set $hash{$id}{'fname'} to "foo". As a result, you really are trying to set $1{'fname'} to "foo".
What I need to be able to do later is to reference the has created like this:No way, but you will be able to useforeach $key (keys %hash) { print $key, $key{'fname'}, $key{'lname'}, +"\n"; }
foreach $key (keys %hash) { print $key, $hash{$key}{'fname'}, $hash{$key}{'lname'}, "\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: building a hash from a database
by bfdi533 (Friar) on May 02, 2006 at 16:20 UTC |