The class's object method can call an instance's _codemethod:
Don't need no stinkin' Ruby ;-)package Foo; sub makemethod { my $obj = shift; $obj->{'_codemethod'} = shift; # takes a real code reference # in this implementation, # not a string, so renamed } sub callmethod { my $obj = shift; $obj->{'_codemethod'}(@_); } # . . .
After Compline,
Zaxo
In reply to Re: on the fly methods
by Zaxo
in thread on the fly methods
by Ojosh!ro
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |