in reply to on the fly methods
sub makeMethod { my $this = shift; $this->{_coderef} = eval $this->{_codestring} } sub callMethod { my $this = shift; $this->{_coderef}->(@_) }
If you want to do something like this:
then I think you'll have to use AUTOLOAD or some module that provides that functionality.$this->makeMethod( "somenewname", "some code" ); $this->somenewname();
|
---|
In Section
Seekers of Perl Wisdom