in reply to How to specify a specific Module::subroutine as command option

With what you look to be trying, try this:
# Takes a package name, loads the associated module. sub load_module { my $pkg = shift; my $file = $pkg; $file =~ s/::/\//g; $file .= ".pm"; require $file; } # Then at the start of your code, assuming you already # processed the module_name into $module load_module($module); my $parser = $module->new(); # Proceed...
If you go this approach you should understand the basics of Perl's OO support. You should definitely understand bless, have read perltoot, etc.
  • Comment on Re (tilly) 1: How to specify a specific Module::subroutine as command option
  • Download Code