Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re^2: Case insensitive hash key existance

by Your Mother (Archbishop)
on Nov 22, 2017 at 16:51 UTC ( [id://1204038]=note: print w/replies, xml ) Need Help??


in reply to Re: Case insensitive hash key existance
in thread Case insensitive hash key existance

:P

if ( grep fc $str eq fc $_, keys %data ) { # case-insensitive exists

Or to "fix" the data-

$data{fc$_} = delete $data{$_} for keys %data;

As this example should make clear, and haukex's links explained, the entire operation is probably a bad idea as it is destructive (or at least has the appearance of being so if the plain folding is done without deleting.

Log In?
Username:
Password:

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

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

    No recent polls found