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

Re^5: Hash versus chain of elsifs

by choroba (Cardinal)
on Nov 22, 2021 at 12:33 UTC ( [id://11139023]=note: print w/replies, xml ) Need Help??


in reply to Re^4: Hash versus chain of elsifs
in thread Hash versus chain of elsifs

my %junksites = ( "bollyinside.com", "www.bollyinside.com", ... "worldtrademarkreview.com", "www.worldtrademarkreview.com", );

Note that hash needs key and value pairs, so you're storing only the site names without www as keys; the www. prefixed ones are stored as values. Probably not what you want.

The fast way how to initialize the keys is

my %junksites; @junksites{qw{ bollyinside.com www.bollyinside.com ... worldtrademarkreview.com www.worldtrademarkreview.com }} = ();

map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (1)
As of 2026-05-10 18:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.