wchristian/Template-AutoFilter — pull request #5 by bluefeet (2014-03-17 15:56:53+00:00)
Title: Remove "use lib" bit.

Doing "use lib" in modules is bad practice and can cause issues, such as the one that's been biting me for a while and I've finally spent the time to track down to this module.

Here's why it is bad for me, with actual names replaced with fake ones. In my application I have this:

lib/MyApp/Foo/Bar.pm # package MyApp::Foo::Bar
lib/Foo/Bar.pm # package Foo::Bar

Now I `cd lib/MyApp`. Then I `perl -e 'use Template::AutoFilter; use Foo::Bar'`.

The `use Foo::Bar` will actually use the MyApp::Foo::Bar module because Template::AutoFilter has popped .. onto @INC!

In my case this causes a deep recursion in Moose logic during class loading because it would try to load a class, but its package wouldn't match, and it would try again, forever.