Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^5: Safely altering the behaviour of heavily used modules

by demerphq (Chancellor)
on Apr 11, 2006 at 08:03 UTC ( #542476=note: print w/replies, xml ) Need Help??


in reply to Re^4: Safely altering the behaviour of heavily used modules
in thread Safely altering the behaviour of heavily used modules

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

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://542476]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (7)
As of 2020-05-27 13:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    If programming languages were movie genres, Perl would be:















    Results (155 votes). Check out past polls.

    Notices?