Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Given that this works:
my $ref = []; my %hash; $hash{$ref} = 1; print keys %hash;
and returns "ARRAY(0x.....)", my question is; is this likely to bring about some tutting and shaking of heads in experienced perl developers?
(Some background: I needed a method of storing which anonymous arrays out of a large number had been examined, and quickly checking that store to see if one had already been examined.)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Reference as a hash key
by AnomalousMonk (Archbishop) on Aug 25, 2009 at 16:05 UTC | |
|
Re: Reference as a hash key
by bluestar (Novice) on Aug 25, 2009 at 16:15 UTC | |
|
Re: Reference as a hash key
by LanX (Saint) on Aug 25, 2009 at 16:43 UTC | |
by LanX (Saint) on Aug 25, 2009 at 19:22 UTC | |
by Anonymous Monk on Aug 26, 2009 at 12:23 UTC | |
|
Re: Reference as a hash key
by goeb (Pilgrim) on Aug 25, 2009 at 16:01 UTC | |
|
Re: Reference as a hash key
by ssandv (Hermit) on Aug 25, 2009 at 16:04 UTC | |
|
Re: Reference as a hash key
by Sewi (Friar) on Aug 25, 2009 at 17:39 UTC |