sub generate_method
{
my $self = shift;
my ($name) = @_;
my $method = <generate method and put into namespace>;
return $method;
}
sub can
{
my $self = shift;
my ($name) = @_;
if ( <some rule that determines when a method is handled by AUTOLO
+AD> )
{
return $self->generate_method($name);
}
$self->SUPER::can($name);
}
sub AUTOLOAD
{
my $name = our $AUTOLOAD;
$name =~ s/.*::([^:]+)$/$1/;
my $self = shift;
if ( <some rule that determines when a method is handled by AUTOLO
+AD> )
{
return $self->generate_method( $name )->(@_);
}
$self->SUPER::AUTOLOAD( @_ );
}
Now it is ... kinda. It's slower and annoying, but can be done.
------
We are the carpenters and bricklayers of the Information Age.
Then there are Damian modules.... *sigh* ... that's not about being less-lazy -- that's about being on some really good drugs -- you know, there is no spoon. - flyingmoose
|