Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Using references as hash keys

by traveler (Parson)
on Oct 16, 2005 at 14:36 UTC ( [id://500571]=note: print w/replies, xml ) Need Help??


in reply to Using references as hash keys

Maybe I am confused but what about
my $aref = [1,2,3]; my @other = [1,2]; my $oref = \@other; my $array = Array::AsHash->new({ array => [ $aref => 'Ovid', $oref => 'traveler' ] }); ... push @other, 3; print $array->get($aref); # prints "Ovid" print $array->get([1,2,3]); # fails
If your suggested changes make the second get work, what would it print?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://500571]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (8)
As of 2024-04-23 14:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found