shmem has asked for the wisdom of the Perl Monks concerning the following question:
You get to see a piece of perl code which (condensed) reads:
my $v; # ... $v = $hash{$foo}->{$bar}; # ... some lines later the same location # has to be retrieved to check for changes # to the multilevel hash $ref = [ $foo, $bar ]; my $nv = $hash{$ref}; if ($v eq $nv) { ...
and you are told that this just works. Can it? does it? how so?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: reference as key to hash
by ikegami (Patriarch) on Apr 24, 2009 at 01:54 UTC | |
by shmem (Chancellor) on Apr 25, 2009 at 15:34 UTC | |
|
Re: reference as key to hash
by spx2 (Deacon) on Apr 24, 2009 at 15:09 UTC | |
by ikegami (Patriarch) on Apr 26, 2009 at 03:07 UTC | |
by shmem (Chancellor) on Apr 24, 2009 at 23:13 UTC |