Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

RE: Open Flat File

by Simplicus (Monk)
on May 05, 2000 at 18:11 UTC ( [id://10365]=note: print w/replies, xml ) Need Help??


in reply to Open Flat File

pretty nifty, and a good bit simpler than what I have
written to read flat files. (I use them to save a few
settings (like users and passwords) between scripts in web-
based reporting tools for our computer repair
center.) May I have your permission to shamelessly
reuse your code?
Simplicus

Replies are listed 'Best First'.
RE: RE: Open Flat File
by BBQ (Curate) on May 06, 2000 at 22:32 UTC
    Thanks for the kind words, and yes, you may indeed! That's the reason why I posted it in the first place! :o)

    The reason why I wrote this was because I wanted to have a way to be able to say $CARS{'John'},$CARS{'Mom'} or do averages on %AGES. On the downside, depending on what you're 1st column (the pseudo-primary key), you get a hash that has values like
    $PEOPLE{'John'} eq 'John' $PEOPLE{'Mira'} eq 'Mira' $PEOPLE{'Mom'} eq 'Mom'
    and I always thought that was a very silly waste of memory. I guess one could easily modify the sub to make it more memory/disk efficient, but then again, this is not intended as a database substitute, nor is it intended to run on files with 5000+ lines. So I guess that shouldn't be a worrying issue.

    I also have a SaveFlatFile() (with a home-made "file locking system") which may be of interest. But I think its a bit too long to post here since I had to strip the comments on OpenFlatFile just so that it would fit. If someone finds this could also be of any use, I'll clean it up and post it later on as a link or something...

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (2)
As of 2024-04-19 20:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found