dagolden / ToolSet

(Perl) Load your commonly-used modules in a single import
http://search.cpan.org/dist/ToolSet
4 stars 2 forks source link

rename subs to avoid method collision #1

Open ggl opened 10 years ago

ggl commented 10 years ago

Is there any way to prevent function/method collision such as when using Mojolicious::Lite along with List::Util qw(any)? Both export the "any" sub. Exporter::Tiny has a very useful feature that I haven't seen elsewhere: it allows you to rename the exported functions.

https://metacpan.org/pod/Exporter::Tiny#Renaming-imported-functions

dagolden commented 10 years ago

Not yet, but it's an interesting idea. Right now ToolSet just mocks up a use call, but if the underlying module supports renaming, that should be possible. Actually doing the renaming within ToolSet isn't possible yet.

(Note to self: consider reimplementing with import::into to allow this sort of renaming)