Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Hash Keys case independent

by Itatsumaki (Friar)
on May 04, 2004 at 15:16 UTC ( [id://350364]=note: print w/replies, xml ) Need Help??


in reply to Hash Keys case independent

One way is to standardize on one case for all your keys on insertion, then to force case on retrieval, like this:

%h = ( lc('adobe') => 'abcd', lc('big boss') => 'gcd', ); my $key = 'AdOBe'; $key = lc($key); print $key;
-Tats

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (4)
As of 2024-04-25 14:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found