perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Nagel>
Subject Re: "use overload" with Apache2::Reload
Date Tue, 13 Jun 2006 16:15:37 GMT
Anthony Heading wrote:
> The "+" operator, defined using an anonymous sub, works perfectly. The
> comparison operators work fine _until_ is changed; but they
> then give errors like "Not a CODE reference at <calling module line>".

Just a guess, maybe I am wrong:
------------------------------- seems to handle anonymous subs and sub references different:

package MyClass;
use overload '""' => \&stringify;
seems to be called as a reference to Blah::stringify while

use overload '""' => sub { "blah" }
seems to hold and call the sub ref in place.

So maybe:

(1) MyClass is changed and therefore recompiled

(2) Another handler uses MyClass but

(3) therefore MyClass::stringify reference points to a non-existing code
    location (Not a CODE reference at..)

(4) The in place anonymous sub works but maybe with the old results as the
    sub is still 'in place' and can be called directly

Again: only a guess ;-)


View raw message