in reply to Calling $function from $module

Could you provide some context in which you need to use this type of syntax?

Replies are listed 'Best First'.
Re^2: Calling $function from $module
by Anonymous Monk on Aug 05, 2015 at 23:18 UTC

    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.