Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

RE: RE: Open Flat File

by BBQ (Curate)
on May 06, 2000 at 22:32 UTC ( [id://10483]=note: print w/replies, xml ) Need Help??


in reply to RE: Open Flat File
in thread Open Flat File

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://10483]
help
Chatterbox?
and the web crawler heard nothing...

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

    No recent polls found