in reply to Dereferencing nested references
The key is this:
In there $hash_ref, as it says, contains a reference to a hash. Then you push a reference to $hash_ref (\$hash_ref) onto your array when you just want the hashref ($hash_ref). So change it to push @BuySellHashref, $hash_ref;while (my $hash_ref = $SQLBuy->fetchrow_hashref) { push @BuySellHashref, \$hash_ref; }
Looping is then
for my $hashref (@BuySellHashref) { print $hashref->{personID} . "\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Dereferencing nested references
by ryddler (Monk) on Jan 16, 2001 at 19:29 UTC |