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
$key='movie';
$retrieved = $hash{$key};
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