Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: searching a file

by PrakashK (Pilgrim)
on Mar 19, 2002 at 17:04 UTC ( #152776=note: print w/replies, xml ) Need Help??


in reply to searching a file

I am assuming that you want to search using a strn to get the corresponding valuen.

In that case, a hash is an ideal solution (assuming your file is not too big as to cause memory problems for you). once you have the hash populated, getting a value is as easy as:

my $value_n = $hash{$str_n};

/prakash

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://152776]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (5)
As of 2016-12-03 20:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (59 votes). Check out past polls.