in reply to Re^2: $object->UnrelatedPackage::some_subroutine()
in thread $object->UnrelatedPackage::some_subroutine()
In my particular case this trick will not mess a program, because I use it inside AUTOLOAD so coderefs should not pass through.
But...let's see, you can call
Accidentally, it still not pass through as in that AUTOLOAD I see:$Tcl::Tk::Widget::AUTOLOAD=sub{print 'tricky hacky sub'}; Tcl::Tk::Widget::AUTOLOAD($object)
But I get your point: I should closer revise that module for similar things.my $method = $Tcl::Tk::Widget::AUTOLOAD; # Separate method to autoload from (sub)package $method =~ s/^(Tcl::Tk::Widget::((MainWindow|$ptk_w_names)::)?)// or die "weird inheritance ($method)";
Also, in my case, in Tcl::Tk module AUTOLOAD is used to redirect a method to Tcl/Tk system, so it is not OO trick but rather some kind of redirecting methods to Tcl/Tk.
PS. I was talking about Tcl::Tk as I do not have anything other resembling OO
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: $object->UnrelatedPackage::some_subroutine()
by tilly (Archbishop) on Feb 21, 2005 at 19:47 UTC |