ironcamel / Dancer-Plugin-Email

Simple email sending for Dancer
http://p3rl.org/Dancer::Plugin::Email
6 stars 10 forks source link

Prevent subroutine prototype mismatch between Dancer's load and Module::Load #17

Closed rustyconover closed 10 years ago

rustyconover commented 10 years ago

Without preventing Dancer's load subroutine form being exported it will conflict with Module::Load's load subroutine. Giving warnings like:

Subroutine Dancer::Plugin::Email::load redefined at /usr/local/lib/perl5/site_perl/5.18.2/Module/Load.pm line 30. Prototype mismatch: sub Dancer::Plugin::Email::load: none vs (*;@) at /usr/local/lib/perl5/site_perl/5.18.2/Module/Load.pm line 30.

This patch prevent's Dancer's load keyword from being exported.

ironcamel commented 10 years ago

Thanks @rustyconover. It is strange that I don't see that warning, but what you are saying makes sense. I think a slightly better solution would be: use Dancer qw(:syntax debug warning);. That way we are explicitly importing only the keywords we need, instead of polluting the namespace with all of Dancer's DSL. If you update your PR, I will pull it. Thanks.

rustyconover commented 10 years ago

@ironcamel the pull request has been updated.