in reply to Avoiding variable conflict when importing modules

With all of the bells and whistles in Exporter.pm, it is almost a shame that no provisions were made for renaming on import:

use ModuleA qw( function ); use ModuleB qw( operate=function ); function(); # calls ModuleA::function() operate(); # calls ModuleB::function()
(no, this doesn't work)

But you can roll your own rather easily, for example:

use ModuleB qw( function ); BEGIN { *operate= \&function; undef \&function } use ModuleA qw( function );
There are certainly other ways to do it but I chose this way because it works with bizarre modules like CGI.pm and shouldn't trigger Exporter.pm's warning about exporting functions over the top of each other (if it has or will one day have such a warning). One disadvantage of this method is that you have to be careful of the order in which you use your modules.

        - tye (but my friends call me "Tye")