When Storable comes across a reference blessed into a class, it examines that class to see if there is a 'STORABLE_freeze' method (and _thaw, I guess, but that's out of the scope of this question) that can produce a "serialized" version of that object. If it exists, according to the documentation for Storable, it's to return a serialized version of the object. If no such method exists (or if the first invocation of this method returns an empty list), Storable reverts to what it normally does.

I am just attempting to define a STORABLE_freeze method for the DBI database handle (which seems to be of the DBI::db class, but I haven't been able to investigate past this point yet), which returns a garbage/no-op serialization for the database handle, much like what Storable does by default when you set $Storable::forgive_me and attempt to serialize a coderef or a file handle. Make sense?

Your code seems to work as-is, though, without error (though your _thaw routine is non-sensical from a Storable point of view, as it does nothing to restore the value that was saved, but that doesn't matter), so I'm wondering if I'm doing something wrong at a more fundamental level...


In reply to Re: Re: Avoiding DBI handles with Storable by Fastolfe
in thread Avoiding DBI handles with Storable by Fastolfe

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.