in reply to Re: Simple Data storage
in thread Simple Data storage

Storable is not a good choice here for a guestbook. Storable is just a serialization mechanism. Storable loads the entire datastructure you serialized into memory every time, so once your guestbook grows to 100 MB, every time you run this program perl is gonna chew up at least 100MB of memory.

You should use DB_File or MLDBM (uses Storable or DB_File) or similar (you get persistance, ease of use, low memory overhead regardless of how big the file is ).

MJD says "you can't just make shit up and expect the computer to know what you mean, retardo!"
I run a Win32 PPM repository for perl 5.6.x and 5.8.x -- I take requests (README).
** The third rule of perl club is a statement of fact: pod is sexy.

Replies are listed 'Best First'.
Re: Re: Re: Simple Data storage
by neniro (Priest) on Mar 08, 2004 at 12:53 UTC
    Yes, thats true. Storable is just for small apps or proof of concepts. In most cases i'd prefer a database like MySQL or if this isn't possible SQLite (no need for a separate db-daemon).
Re: Re: Re: Simple Data storage
by Hissingsid (Sexton) on Mar 08, 2004 at 14:54 UTC
    Hi, Thanks for the replies guys.

    The site I'm working on is a community project on a shared server so I'm resticted in what modules I can use. I've just run PerlDiver to check what is available and none of the modules mentioned here are installed.

    Perl 5.6.1 is the version running on the server. Are there other modules that you can suggest I look for and mug up on or any ides on a solution that does note require any modules other than CGI would be helpful.

    Many Thanks again.

    Best wishes

    Sid

      there are quite a few nodes around here about installing modules for your specific username. I don't have reference to any of them on hand.. but you should be able to install these modules on your server w/o affecting anyone else's work.

      Grygonos
        use lib (@mylistOfModsFolders_is_recursive);

      Storable is no worse than require 'savefile'; in this case. I think it is included with Perl 5.6.1.

      If you print out a file then require it back in, and your escaping is not correct you're opening yourself to code injection. Storable would protect you from this.