in reply to Re: Unlimited chaining (is there a way to detect this?)
in thread Unlimited chaining (is there a way to detect this?)
Second, what do you mean 'detect it'?Well... To be able to display a warning (or die) like: "Deep recursion on method foo ... " after a certain count. If that makes sense? It was just a thought :) actually re-designing the code like this solves this issue (yes, I've stopped doing it):
However, the situation about this method chaining seemed interesting to me and I opened a discussion about it.package NewBase; use strict; sub new { my $class = shift; my $self = {}; bless $self, $class; $self; } # other methods package BaseClass; use strict; use base qw(NewBase); sub bar { return Foo->new; } package Foo; use strict; use base qw(NewBase);
|
---|