I don't recommend this technique, but have a look at AUTOLOAD:
our $AUTOLOAD; sub AUTOLOAD { if( $AUTOLOAD =~ /.*?::function_(\w+)$/ ) { function_x( $1 ); } else { die "Unknown function '$AUTOLOAD' called"; }; }
Update: Perlbotics points out that my approach needs to skip main:: or other package names.
In reply to Re: Technique for building arguments from function name?
by Corion
in thread Technique for building arguments from function name?
by nysus
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |