One thing I forgot to mention is that the variable that encompasses the name of the subroutine should somehow reflect which sub it represents.
Doing something like the following in a file with hundreds or thousands of lines of code can be frustratingly confusing:
my $method_1 = 'twist_rubber_arm'; my $var_6 = 'choke_chicken'; my $x = 'let_cat_out_of_bag'; # far, far later on in the code say $object->$var_6('tomorrow');
What the hell is $var_6 again?!? Time to go wading through code. Even with a good editor/IDE, backtracking is a time sink. Best to use names that are clearly representative in some way (as with all variables regardless if they map to a subroutine or not).
In reply to Re^3: How can I call a Perl sub with an object from a sub name stored in a var?
by stevieb
in thread How can I call a Perl sub with an object from a sub name stored in a var?
by misterperl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |