Subject: | Template::Plugin::Class should report attempts to call non-existant methods |
Hi,
We're using Template::Plugin::Class 0.12 and finding it very useful. Yesterday we encountered a problem whereby calling a non-existant method didn't produce a helpful error message. I have attached a small patch that deals with this.
Tom
--- Template/Plugin/Class.pm.was Tue Jan 13 13:58:39 2004
+++ Template/Plugin/Class.pm Thu Apr 15 18:02:27 2004
@@ -27,11 +27,13 @@
package Template::Plugin::Class::Proxy;
use vars qw( $AUTOLOAD );
+use Carp qw(carp);
sub AUTOLOAD {
my $self = shift;
my $class = ref $self;
my ($method) = ($AUTOLOAD =~ /^$class\::(.*)/);
+ $$self->can($method) or carp "$$self cannot $method";
$$self->$method(@_);
}