You can do that (see perlref):
('additional_test_module::'.$var1)->(object_vars($var1));
But I think you don't want to.
There are some problems with the approach:
A better approach is:
our %subs=('value X'=>\&module::subX, 'value Y'=>\&module::subY, 'somethingelse' => \&module::else); $var=get_the_var(); if (test($var)) { if (exists $subs{$var}) { $subs{$var}->(object_vars($var)) } else { signal_error($var) } }
This stores all known subs in a hash, then calls the right one.
Oh, I'm assuming that when you say "don't know the variable name" you mean the "value".
If you really don't know the possible values of the var, or the possible subs to call, then you have other problems than to worry about 'strict', so you can go with my first code, and in the meantime re-design the system ;-)))
--
dakkar - Mobilis in mobile
In reply to Re: executing subroutines via variable
by dakkar
in thread executing subroutines via variable
by Angel
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |