adimo has asked for the wisdom of the Perl Monks concerning the following question:

Why the following code does not work :
use Devel::Pointer; my %hash; $hash{1} = 2; my $code = &create(\%hash); print "CODE : ".$code."\n"; my $ref = &extract($code); print "REF : ".$ref."\n"; sub create { my $self = shift; return(address_of($self)); } sub extract { my $self = shift; return(deref($self)); }
Another question is why each time I use the address_of method the return value is different for the same reference. Is there a way to decode this value so I can use it as an hash key ?

Originally posted as a Categorized Question.