Skip Menu |

This queue is for tickets about the Scalar-Defer CPAN distribution.

Report information
The Basics
Id: 31039
Status: open
Priority: 0/
Queue: Scalar-Defer

People
Owner: Nobody in particular
Requestors: siracusa [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: (no value)
Fixed in: (no value)



Scalar::Defer 0.11 breaks Rose::HTML::Objects 0.550. The following patch fixes it, though I'm not sure if it's universally valid. --- lib/Scalar/Defer.pm 2007-11-28 12:03:20.000000000 -0500 +++ lib/Scalar/Defer.pm~ 2007-11-25 14:30:00.000000000 -0500 @@ -89,7 +89,7 @@ no strict 'refs'; no warnings 'redefine'; - foreach my $sym (grep { $_ ne 'AUTOLOAD' } keys %UNIVERSAL::) { + foreach my $sym (keys %UNIVERSAL::) { *{$sym} = sub { unshift @_, Scalar::Defer::SUB_FORCE()->(shift(@_)); goto &{$_[0]->can($sym)};
Here's a more generic patch: --- lib/Scalar/Defer.pm.old 2007-11-25 14:30:00.000000000 -0500 +++ lib/Scalar/Defer.pm 2007-11-28 13:04:13.000000000 -0500 @@ -90,9 +90,16 @@ no warnings 'redefine'; foreach my $sym (keys %UNIVERSAL::) { + my $original_code = \&{$sym}; *{$sym} = sub { unshift @_, Scalar::Defer::SUB_FORCE()->(shift(@_)); - goto &{$_[0]->can($sym)}; + + if(my $code = $_[0]->can($sym)) { + goto &$code; + } + else { + &$original_code; + } }; }
Okay, third time's the charm (forgot a goto in the last patch): --- lib/Scalar/Defer.pm.old 2007-11-25 14:30:00.000000000 -0500 +++ lib/Scalar/Defer.pm 2007-11-28 13:09:53.000000000 -0500 @@ -90,9 +90,16 @@ no warnings 'redefine'; foreach my $sym (keys %UNIVERSAL::) { + my $original_code = \&{$sym}; *{$sym} = sub { unshift @_, Scalar::Defer::SUB_FORCE()->(shift(@_)); - goto &{$_[0]->can($sym)}; + + if(my $code = $_[0]->can($sym)) { + goto &$code; + } + else { + goto &$original_code; + } }; }