in reply to building a hash from a database
use strict;!!!
You're doing this in two steps. As a result of the line
$hash{$rowdata->{'id'}} has an integer for a value, and you're using that as a symbolic reference to a new hash.$hash{$rowdata->{'id'}} = $rowdata->{'id'};
use strict would have prevented you from doing that.
I think you can change the code to do what you want, by changing that line to
$hash{$rowdata->{'id'}} = { '' => $rowdata->{'id'} };
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: building a hash from a database
by bfdi533 (Friar) on May 02, 2006 at 15:42 UTC | |
by bart (Canon) on May 02, 2006 at 15:44 UTC | |
by bfdi533 (Friar) on May 02, 2006 at 16:20 UTC |