Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Using references as hash keys

by Ovid (Cardinal)
on Oct 16, 2005 at 03:56 UTC ( [id://500531]=perlquestion: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my $array = Array::AsHash->new({array => \@array});
    my $value = $array->get($some_reference);
    
  2. or download this
    my $aref = [1,2,3];
    my $array = Array::AsHash->new({
      array => [ $aref => 'Ovid' ]
    });
    print $array->get($aref);   # prints "Ovid"
    print $array->get([1,2,3]); # fails
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://500531]
Approved by davido
Front-paged by monkfan
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (4)
As of 2024-04-18 22:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found