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"}
In reply to Dereferencing references by delip
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |