sub template { my $e = shift; my %actionhandlers = ( p => sub {...blougat...}, b => sub {...blimblim...}, u => sub {...hoohaa...} ... ); return sub { ... common stuff ... $actionhandlers{$e}->(...args_if_any...); ... more stuff ... }; }
In reply to Re: Building an anonymous subroutine
by oylee
in thread Building an anonymous subroutine
by BorgCopyeditor
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |