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

Re: Online database with DBMs??

Thread Previous
From:
Jenda Krynicky
Date:
February 26, 2002 14:07
Subject:
Re: Online database with DBMs??
Message ID:
3C7C14FD.20952.58F9528@localhost
From:           	"Matt Schaft" <matt@gifu21.com>
> I am trying to make a linguistic database app. for the web.  As I am
> new to Perl and not a programmer this is proving to be quite a
> challenge.  My original idea was to use Perl's DBMs and a hash of
> arrays that looks like this :
> 
> { phrase1  =>  ["meaning1", "meaning2",..."meaningN","note1",
> "note2",..."noteN"] }
> 
> Everything seems to function fine (I'm still in the offline phase) but
> I get no output when I go to print the hash only the keys come out.

DBMs usualy do not allow storing arrays or anything like that in the 
values. You can only store a simple scalar there.

You will either have to use MLDBM or "serialize" the data yourself. 
For example you could join the "meaning"s using a character that's 
guaranteed to never appear there and store the resulting string in 
the DBM. And then you'll just split the string.

HTH, Jenda


=========== Jenda@Krynicky.cz == http://Jenda.Krynicky.cz ==========
There is a reason for living. There must be. I've seen it somewhere.
It's just that in the mess on my table ... and in my brain.
I can't find it.
					--- me

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About