CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Intermediate:
help with hash/database

 



airo
stranger

Oct 7, 2001, 3:59 PM

Post #1 of 2 (329 views)
help with hash/database Can't Post

I canít decide the best way to do this:
I need to build a database like this,
key = colors=>
color1 => red
color2 =>blue
color3 => black
ectÖ
key = shapes=>
shape1 => oval
shape2 => square
shape3 => circle
ectÖ
ectÖ

I need to search on key and return each item separately when called.
Would this be a multi dimensional hash? If so then would I have
to use MLDBM ? Iíve tried several different approaches with no luck
if this is something simple I apologize, but I just canít get it.
also I need to stay with dbm files and away from mysql and the likes.

thanks
paul




yapp
User

Oct 10, 2001, 1:12 AM

Post #2 of 2 (317 views)
Re: help with hash/database [In reply to] Can't Post

The only thing I know about such information is that you can use dbmopen() to tie an hash to a file, and dbmclose() to untie. When the hash is tied, it will contain the information located in the DMB file. Any change to the hash will automatically be changed in the file aswell.

Modern Perl however, mas more features like tie(), untie() and some modules. I haven't studied anything about tha, since I didn't need it recently. If anyone can answer this commen shared question of us, please do so.

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives