delip has asked for the wisdom of the Perl Monks concerning the following question:
When I run this I get Can't use string ("HASH(0x90fcc70)") as a HASH ref while "strict refs" in use Is there anyway to make it work? It is not possible to change the data structures used there.use strict; my %h = ("foo" => 1, "bar" => 2); my %g = (); $g{\%h} = 1; my @k = keys %g; my $hashref = $k[0]; my %tmp = %$hashref; print $tmp{"foo"}
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Dereferencing references
by tirwhan (Abbot) on Feb 09, 2006 at 10:50 UTC | |
|
Re: Dereferencing references
by planetscape (Chancellor) on Feb 09, 2006 at 11:12 UTC | |
|
Re: Dereferencing references
by Fletch (Bishop) on Feb 09, 2006 at 13:33 UTC |