philosophia has asked for the wisdom of the Perl Monks concerning the following question:
Output is:print "create hashref\n"; my $closurehash = $sth->fetchall_hashref("name"); foreach $key ( keys(%{$closurehash}) ) { print "$closurehash->{$key}->{'name'}\n"; } print "add to hashref\n"; $closurehash->{ "test" } = "test"; # hash ref foreach $key ( keys(%{$closurehash}) ) { print "$closurehash->{$key}->{'name'}\n"; } print "delete from hashref\n"; delete $closurehash->{"fake35"}; foreach $key ( keys(%{$closurehash}) ) { print "$closurehash->{$key}->{'name'}\n"; }
I'm not sure why it is not adding to the hash reference correctly. What am I doing wrong? Thanks.create hashref fake35 add to hashref fake35 delete from hashref
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: add and delete to hash reference
by Joost (Canon) on Jul 25, 2007 at 21:19 UTC | |
|
Re: add and delete to hash reference
by GrandFather (Saint) on Jul 25, 2007 at 21:20 UTC | |
|
Re: add and delete to hash reference
by fmerges (Chaplain) on Jul 25, 2007 at 21:16 UTC | |
|
Re: add and delete to hash reference
by oxone (Friar) on Jul 25, 2007 at 21:22 UTC |