Hi all!

I have written a module similar to CGI::Persistent, but then intended for MySQL.

The idea is simple. Once a scripts initiates a new object, the constructor reads the propper data from the database and thaws it (I use Storable qw(thaw nfreeze) for this) I check wheter an ID was given when calling the ->new routine. If not I read the &CGI::param("id") (or ID) for an ID. The ID is looked up in the DB, the data thawn and given back in the object to the script.

I also have a ->store() routine, which I don't want to force upon my module users so I have it called upon from the ->DESTROY() routine.

This works fine when testing stuff on the shell, but under apache, this doesn't work...

I use base qw(CGI) - so I was wondering wheter my DESTROY isn't called because the CGI::DESTROY is called or if it isn't called because of the way the scripts die under apache's wings...

Thanks in advance 4 all ur answers!

Sinister greetings.
"With tying hashes you can do everything God and Larry have forbidden" -- Johan Vromans - YAPC::Europe 2001
perldoc -q $_

In reply to $obj-DESTROY isn't called upon by Sinister

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.