I'm refactoring a big if/else decision tree that sets some $args, loads a module, possibly does other random stuff, and then calls a function from that module. Previously each elsif had contained code to set $args, load the module, do the random stuff, and call the function. Being able to call ( &{ $module.'::'.$function } )->( $args ); gets rid of much of the repetitive code.
In reply to Re^2: Calling $function from $module
by Anonymous Monk
in thread Calling $function from $module
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |