Skip Menu |

This queue is for tickets about the Object-Lazy CPAN distribution.

Report information
The Basics
Id: 79720
Status: resolved
Priority: 0/
Queue: Object-Lazy

People
Owner: STEFFENW [...] cpan.org
Requestors: DOUGLISH [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.12
Fixed in: (no value)



If build object subroutine works with another Object-Lazy, $AUTOLOAD is changed and the also requested method is changed. To fix this simply store locally $AUTOLOAD value before calling the build subroutine and after that use stored value. Patch attached.
Subject: object-lazy.patch
--- Lazy.pm 2012-08-18 22:21:07.000000000 +0200 +++ /usr/local/share/perl/5.10.1/Object/Lazy.pm 2012-09-18 14:19:33.000000000 +0200 @@ -47,8 +47,11 @@ sub AUTOLOAD { ## no critic (Autoloading ArgUnpacking) my ($self, @params) = @_; + our $AUTOLOAD; + my $orig_autoload = $AUTOLOAD; + my $built_object = $build_object->($self, \$_[0]); - my $method = substr our $AUTOLOAD, 2 + length __PACKAGE__; + my $method = substr $orig_autoload, 2 + length __PACKAGE__; return $built_object->$method(@params); }
Thank you for reporting. Please add a short test that fails with the current module. At the moment I have no idea how I can reproduce that. --Steffen
solved in already uploaded version 0.13