develooper Front page | perl.beginners | Postings from March 2002

Passing question on DMB files with complex stuff

Thread Next
Frank 'Olorin' Rizzi
March 4, 2002 20:54
Passing question on DMB files with complex stuff
Message ID:
So, I love DBM files,
because I think they'll work just great for the application I have to

So far I worked with simple hashes (key => value) on DBM files, and
everything seems fine.
However, I now realize I need to complicate matters a bit.

Instead of a simple hash, I'll need something with a key, and two scalars
associated to it.
In more classical terms (I know, many of you won't like this..) the key is
going to be a string,
and each key should lead to a string AND an integer.

Things I have to do with this structure:

assume I have data in a text file ("") with data in the format
this_is_a_key    this_is_a_value    n
(they are tab-separated)

1- get the data from and create/update a DBM file pair

assume I have a nother file "" with data in the format
(one per line)

2- check if each string in the file corresponds to a 'record' in
the DBM file pair
(depending on the result fo the check I'll do different stuff)

This is not very complicated. I have it down for a simple hash, but I'd like
to hear suggestions on how
to do this for this slightly more complex set up. It's a matter of
experience. Having about zero XP with Perl,
I'd rather listen before jumping into it...

thank you in advance,

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About