in reply to Call sub in variable module
G'day tel2,
The documentation for require explains how to achieve this. See the text, about half-way down, near:
eval "require $class";
Update: Sorry, I appear to have missed the last line of your post:
"Also, if each module will always contain only 1 sub, do they need to have a sub at all? If not, how can they be written & called without a sub?"
That's not addressed in the require documentation.
Actually, I don't understand what you're asking here which appears to be "How to call a sub that doesn't exist?". Please elaborate.
— Ken
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Call sub in variable module
by tel2 (Pilgrim) on Nov 07, 2016 at 01:54 UTC | |
by kcott (Archbishop) on Nov 07, 2016 at 04:02 UTC | |
by tel2 (Pilgrim) on Nov 08, 2016 at 00:50 UTC |