On 03/01/2008, Ovid <[EMAIL PROTECTED]> wrote: > --- demerphq <[EMAIL PROTECTED]> wrote: > > > > The problem is this line in Template::Timer: > > > > > > my $super = __PACKAGE__->can("SUPER::$sub") or die; > > > > > > This is OO code and that should actually read: > > > > > > my $super = __PACKAGE__->can($sub) or die; > > > > Er, i dont see how it could. Then $super would have a reference to > > its own method and not its parents. > > I should have posted more context. What's happening is that > Template::Timer inherits from Template::Context and that line merely > checks that two methods which it inherits actually are available. If > they are, it wraps them in timing code. It does *not* implement those > methods directly so it can't have a reference to its own method. > > An alternative would be to do search @ISA or refer to the base class > directly: > > my $super = Template::Context->can($sub) or die; > > That's a bit ugly and not really in the OO spirit, but it also works > around the fact that it doesn't play well with UNIVERSAL::can.
This is all strange, but now i understand what you mean. Thanx. Yves -- perl -Mre=debug -e "/just|another|perl|hacker/"