<?xml version="1.0" encoding="windows-1252"?>
<node id="437792" title="Re^2: Safely altering the behaviour of heavily used modules" created="2005-03-08 21:59:38" updated="2005-08-13 13:01:45">
<type id="11">
note</type>
<author id="144870">
adamk</author>
<data>
<field name="doctext">
Well, by "race easily" I mean for example that some uses of STORABLE_thaw are something like...
&lt;code&gt;
sub STORABLE_thaw {
    my ($self, $string, @refs) = @_;

    ...

    %$self = %rebuilt_contents;
}
&lt;/code&gt;
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.&lt;br&gt;
&lt;br&gt;
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.</field>
<field name="root_node">
437784</field>
<field name="parent_node">
437787</field>
</data>
</node>
