Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: redudent hash

by citromatik (Curate)
on Jun 22, 2009 at 12:56 UTC ( #773602=note: print w/ replies, xml ) Need Help??


in reply to redudent hash

If you are using Perl 5.10 you can use the given ... when construction. See perlsyn

Update: Sorry, read too fast. Let's try again:

All the

foreach $id (keys %$HR_Cwnt) { if ($id =~ /.*?\.oracle.*?$/) { delete($$HR_Cwnt{$id}); } }

Can be simplified using Tie::Hash::Regex to something like:

delete $HR_Cwnt->{/.*?\.oracle.*?$/}

citromatik


Comment on Re: redudent hash
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (9)
As of 2014-10-21 06:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (97 votes), past polls