in reply to Module suboutine needs dereferencing?
This can be done through symbolic references. If the module name is a literal and the subroutine name is a variable, then you can use
to access the subroutine. And make sure that when calling this subroutine you put parentheses around the arguements as well. Also note that you cannot do this if use strict 'refs' is in effect.&{"Modname::$subname"}
Personally, I would avoid using symbolic references if I could help it and just stick with using real references. For example you could create a hash of subroutine references:
and then call it withmy %table = (name1 => \&subname1, name2 => \&subname2 ... );
$table{$name}->( ... args ... )
|
|---|