sub makeMethod { my $this = shift; $this->{_coderef} = eval $this->{_codestring} } sub callMethod { my $this = shift; $this->{_coderef}->(@_) } #### $this->makeMethod( "somenewname", "some code" ); $this->somenewname();