Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Using references as hash keys

by traveler (Parson)
on Oct 16, 2005 at 14:36 UTC ( #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? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (5)
As of 2023-02-01 12:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I prefer not to run the latest version of Perl because:







    Results (3 votes). Check out past polls.

    Notices?