… | |
… | |
121 | sub widget { $_[0]{widget} } |
121 | sub widget { $_[0]{widget} } |
122 | |
122 | |
123 | sub AUTOLOAD { |
123 | sub AUTOLOAD { |
124 | $AUTOLOAD =~ /::([^:]+)$/ or Carp::confess "$AUTOLOAD: no such method (illegal name)"; |
124 | $AUTOLOAD =~ /::([^:]+)$/ or Carp::confess "$AUTOLOAD: no such method (illegal name)"; |
125 | ref $_[0]{widget} or Carp::confess "AUTOLOAD: non-method call $AUTOLOAD(@_)\n"; |
125 | ref $_[0]{widget} or Carp::confess "AUTOLOAD: non-method call $AUTOLOAD(@_)\n"; |
126 | my $method = $_[0]{widget}->can($1) |
126 | my $method = $_[0]{widget}->can ($1) |
127 | or Carp::confess "$AUTOLOAD: no such method"; |
127 | or Carp::confess "$AUTOLOAD: no such method"; |
128 | # do NOT cache.. we are fats enough this way |
128 | # do NOT cache.. we are fats enough this way |
129 | unshift @_, shift->{widget}; |
129 | unshift @_, shift->{widget}; |
130 | &$method; |
130 | &$method; |
131 | } |
131 | } |