in reply to Calling same named functions from different modules
Sure. There are a few ways. The most obvious to me, being somewhat of an OO guy, is to modify the functions to become methods - even just package methods. This is as simple as throwing away the first parameter. Then you can do something like this:
my %versions = ( 1 => 'interface1', 2 => 'interface2' ); my $interface = $versions{$version}; $interface->some_func();
If you can't go and modify the interfaces, perhaps you can play with the imports a bit. This is a bit more dangerous, but probably will work.
my %versions = ( 1 => 'interface1', 2 => 'interface2' ); my $interface = $versions{$version}; $interface->import(); some_func();
Just realise that the currently-imported version is a global variable (*some_func), with all the repurcussions that implies. You may also get method-redefined messages, although I don't think so, so please test it ;-)
|
|---|