Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
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


Comment on Re: searching a file
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (11)
As of 2015-07-03 13:26 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 (53 votes), past polls