On 8 July 2011 21:04, Ekki Plicht (DF4OR) <e...@plicht.de> wrote: > around 'kdnr' => sub { > my ($org, $self, $value) = @_; > return $self->kdnr unless $value; #... > return $self->kdnr($value); > };
> When reading the data set the debugcounter skyrockets within seconds, > a little bit later I get a "Deep recursion" error and much later the > process is killed. Well. Yes. Each 'around' modifier is calling back to the method it's wrapping, which calls the around modifier, which ... What you're missing is that the around modifier is passed a reference to the original method in $_[0]. You're capturing it into $org. All you need to do is redispatch that method rather than the one you're wrapping. That is: return $self->$orig unless $value; .... return $self->$orig($value); HTH, /joel