Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re^2: Hash/file --> doesn't seem to work

by Crian (Chaplain)
on Jun 10, 2009 at 09:37 UTC ( #770264=note: print w/ replies, xml ) Need Help??


in reply to Re: Hash/file --> doesn't seem to work
in thread Hash/file --> doesn't seem to work

But this way vou have to read the big file often. As supposed above it would be better, to switch the while loops.

untested:

while(<FILE>) { chomp; my ($objid,$other) = split(/\s+/,$_); while(my ($key,$value)= each (%hash_table)) { if($objid =~ /$key/i) { print "$key is present in $objid\n"; } else { next; } } }


Comment on Re^2: Hash/file --> doesn't seem to work
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (5)
As of 2015-07-03 23:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (57 votes), past polls