There are a number of modules that contain the Run method. You need to connect a module whose name contains the $var variable and call the Run method from it.

Closed due to the fact that the essence of the question is incomprehensible to the participants tutankhamun , cheops , pavel , aleksandr barakin , HamSter Sep 19 '16 at 13:13 .

Try to write more detailed questions. To get an answer, explain what exactly you see the problem, how to reproduce it, what you want to get as a result, etc. Give an example that clearly demonstrates the problem. If the question can be reformulated according to the rules set out in the certificate , edit it .

  • one
    What is your problem? There is no question in your question. Please read the help section on how to ask questions and reformulate your question so that you can be answered. - Nikolaj Sarry

1 answer 1

 #!/usr/bin/env perl use Modern::Perl; use Const::Fast; const my $METHOD => 'Run'; my @modlist = qw/a::ab::b/; for( @modlist ) { eval "use $_;"; if( $@ ) { say "Can not load module $_: $@"; next; } my $method = $_->can($METHOD); unless( $method ) { say "Module $_ does not contain method $METHOD!"; next; } $method->(); }