No such thing as a small change | |
PerlMonks |
Re: Building an array of hashes from databaseby snax (Hermit) |
on Sep 26, 2003 at 17:03 UTC ( [id://294497]=note: print w/replies, xml ) | Need Help?? |
As noted above, the hash ref isn't quite right in your code. Try this:
You can drop the my %data; statement using this approach, too. This makes it clear (to my eye, of course) that a new (anonymous) hash ref is used each time around. Check out perlref for more stuff on anonymous data structures and references. Good stuff :)
In Section
Seekers of Perl Wisdom
|
|