Your skill will accomplish what the force of many cannot |
|
PerlMonks |
DB_File vs flat file in terms of speedby kiat (Vicar) |
on Oct 25, 2002 at 15:35 UTC ( [id://208042]=perlquestion: print w/replies, xml ) | Need Help?? |
kiat has asked for the wisdom of the Perl Monks concerning the following question:
Hi Monks I'm new to perl's database modules and I'm now experimenting with 'use DB_File'. I've been used to parsing data from a flat text file but am considering using a proper database such as DB_File. Let's say I've 1000 entries stored as follows: orange:fruit bicycle:transport movie:entertainment abc:alphabet . . and so on. Let's say I want to retrieve the entry 'movie' and modify it. With a flat file, I would need to loop through the entire file to find a match and then make the modification. With 'use DB_File' and using 'tie', I can locate the entry simply by using the key 'movie' as in to retrieve its corresponding value. It appears then that using DB_File is a lot faster and more efficient. Am I on the right track with regards to how DB_File via 'tie' works and the merits of DB_File as a method storing and retrieving data? I look forward to hearing your feedback and comments :) cheers, kiat
Back to
Seekers of Perl Wisdom
|
|