That's because $obj->can('meth') returns the coderef to execute!sub FETCH { my($self, $key) = @_; unless (exists $self->{$key}) { if (my $meth = $self->can($key)) { $self->{$key} = $meth->($self); } else { warn "No method for '$key'"; $self->{$key} = undef; } } return $self->{$key}; }
-- Randal L. Schwartz, Perl hacker
In reply to RE: A cacheing tied hash base class
by merlyn
in thread A cacheing tied hash base class
by rdw
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |