Im actually pretty familiar with this class of problems from working on Data::Dump::Streamer (whcih actually can and has to deal with much more complicated cases than Storable). In DDS I handle this by resolving the object first, then by resolving the copies of the ref. Thats why in a DDS dump youll often see stuff like 'V: $obj1->{foo}' which indicates that the value is a placeholder which will be replaced by a value of $obj1->{foo} when it has been completely defined. (You might also see 'A: $obj1->{foo}' meaning that the value is an alias of the named variable and not a copy of its value).

There is another aspect to this as well. To a certain extent its not Storables problem if a thaw method results in a breaking circular refs. Most time it wont be a problem and when it is its not Storables fault so I see no reason not to support the possibility.

So for instance in DDS its possible to make a freeze method that will make DDS go completely nuts. I dont view this as a problem for DDS as I see freeze/thaw semantics as being rope, and if people wish to use that rope to hang themselves thats their business.

Anyway, its sounds to me like Storable has somehow painted itself into a corner and that this problem is harder to deal with because of it. And it makes me all the more glad that I didnt copy the storable freeze/thaw interface in DDS.

---
$world=~s/war/peace/g


In reply to Re^5: Safely altering the behaviour of heavily used modules by demerphq
in thread Safely altering the behaviour of heavily used modules by adamk

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.