I have two modules, interface1.pm and interface2.pm. They contain different sets of functions with the same names. Is there any way I can use both of them, and call the function I want by name, the module it uses being dependant on a variable?
For example, if I call the function terraform which is described in both interfaces and the variable $version is 1, then the interface1.pm version of terraform will be used. If version was 2, interface2.pm would be used.
That's what I'd like. Of course I'm noticing I can't load the two sets of functions without them overwriting each other, even if I say:
I was hoping I could do that, and then use a combination of use and no when I wanted to switch "versions" in the program. But no, foiled at the outset.use interface1 (); use interface2 ();
I might be approaching this improperly, if so please nudge me in the right direction.
Thanks a lot!
GrandFather altered the title. Title was versioning
In reply to Calling same named functions from different modules by geckosan
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |