http://qs321.pair.com?node_id=467493

lvanhout has asked for the wisdom of the Perl Monks concerning the following question:

Does dbmopen() still work?

I have read that it was discarded in perl 5, but may be emulated. Certainly it wont be supported in the future. It appears that tie() should be used now, and it seems with tie you have create your own class and define every function your self.

I need the Hash <-> file functionality that dbmopen() had. Is this capablity still available and built into the tie() function or is writing my own class for tie() the only way? Is there something for array <-> file?.

My constraint for this project is that my access is restricted to the /home/<my account>/, cgi-bin, and html directory, I can't install anything that doesn't go in these.

It is possible that I may have access to mySQL, I'm checking, if so I may just go with the full database. So this may resolve itself in another direction, but I would still be curious about an answer for my question.

I have read the tie() document under the tutorial pages. If there is another good resource for tie() please let me know.

Thank you for any help
Lane

UPDATE: Sorry for being confusing, I dont have rights to install.

I belive the host supports mod perl but unsure, I will check on that as well.

Mostly I wanted to update an old cgi (perl but not mod perl) program that uses flat files. I'm trying to feel out some better options.

Replies are listed 'Best First'.
Re: Is dbmopen() around in another form?
by merlyn (Sage) on Jun 16, 2005 at 23:11 UTC
      Yeah I started to look at DBD::SQLite, but it needs to be installed. And for this project I cant install software other then cgi stuff. I will look at the Cache::Cache and DBM::Deep. Thank you

      Lane
        Uh, why are you ruling out things that must be "installed"? Have you not seen perlmodinstall?

        But worse, you rule out $package1 because it has to be installed, but then you talk about $package2 and $package3, neither of which are core. That's very confusing.

        -- Randal L. Schwartz, Perl hacker
        Be sure to read my standard disclaimer if this is a reply.