Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Safely altering the behaviour of heavily used modules

by kvale (Monsignor)
on Mar 09, 2005 at 01:55 UTC ( #437787=note: print w/replies, xml ) Need Help??


in reply to Safely altering the behaviour of heavily used modules

You have probably done this already, but it would be useful to add tests for both the new behavior situation and the old default. Check objects returned for both cases, which is something that may not be done in the current test suite. Check that freezing and thawing close the loop in both cases. I'm not sure what race easily means, but I am sure that you will have to deal with it in your proposal.

Add documentation describing changes and give example code where the new behavior may be useful.

-Mark

  • Comment on Re: Safely altering the behaviour of heavily used modules

Replies are listed 'Best First'.
Re^2: Safely altering the behaviour of heavily used modules
by adamk (Chaplain) on Mar 09, 2005 at 02:59 UTC
    Well, by "race easily" I mean for example that some uses of STORABLE_thaw are something like...
    sub STORABLE_thaw { my ($self, $string, @refs) = @_; ... %$self = %rebuilt_contents; }
    Now, if called in scalar context, that should return the number of elements in the listified hash, which won't be a problem. But it's only safe accidentally, not by design. The original author was told that anything that might be returned would be ignored.

    But there is the potential for one of these cases where the function doesn't have an explicit "return;" to accidentally return a different object of the same class, which the new behaviour would interpret as an alternate object and treat incorrectly.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://437787]
help
Chatterbox?
[marto]: hey Corion, how's tricks?
[Corion]: marto: Currently all well - work is even OK currently ;) I should start translating my WWW::Mechanize:: Chrome talk to English and recheck that my demos all work, but I have two weeks for that still :)
[Corion]: So, most things are looking good :-D
[Corion]: I should write some more code for my Jekyll clone, but I don't feel like it, so maybe I should just let that linger instead ;)
[karlgoethebier]: "...mein enemy..."

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (8)
As of 2017-07-26 10:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I came, I saw, I ...
























    Results (390 votes). Check out past polls.