As bvr noted, you turned your arguments over to bless in the constructor. Therefore, although this is an immediate problem for your code, an important consideration when writing re-mailing methods is to use the goto &sub syntax to erase the frame of the AUTOLOAD call AUTOLOAD :
sub AUTOLOAD { my ($name) = our $AUTOLOAD =~ /::(\w+)$/; Log::method_call( $name, @_ ); my $self = shift;
If the redispatched method uses the built-in caller for something (installation methods, variable localization, Carp error reporting ...), then this method will keep caller functional. Using the original line return $$self->$name(@_) will always report that caller was the last line of the AUTOLOAD sub, which, in turn, could be the source of hard-to-reach errors.
If you want to improve the error message a bit, you can write the last line as:
goto &{ $$self->can($name) or Carp::croak "no method '$name' on $$self" };
It is assumed that the Carp package has been downloaded.
source share