Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^3: external file reference

by jakobi (Pilgrim)
on Oct 28, 2009 at 17:41 UTC ( [id://803744]=note: print w/replies, xml ) Need Help??


in reply to Re^2: external file reference
in thread external file reference

14k lines of normal line sizes of maybe 100 chars isn't that bad. Consider reading the file into something like $hash{userid}.

which Keszler already said while I as usual did forget to check for new replies before create

Then, if you find the hash build time being significant wrt total runtime, while your 14k file is fairly static: consider a lightweight database like sqlite accessed via DBI.

If you've many independent script or parallel script runs, keeping the hash in memory in a separate process might also be worthwile (old-style client server or some shared memory setup - but that's somewhat like a coding challenge looking for a problem).

cu & HTH, Peter -- hints may be untested unless stated otherwise; use with caution & understanding.

Replies are listed 'Best First'.
Re^4: external file reference
by Spooky (Beadle) on Oct 30, 2009 at 16:26 UTC
    OK, ..lets say I do something like this: $hash{$userid} where $userid is a character string. How would I populate this with data elements that would be both numeric and alpha so that when I key in on say "ewh1234" I could pull all or a specific element within the array(?) - e.g., "ewh1234" may contain 'engineer, 23.4, 1.2, local' (4 data items within "ewh1234")? ..thanks

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (4)
As of 2024-04-18 18:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found