http://www.perlmonks.org?node_id=902546


in reply to Re^2: use lib $lib_dir not working
in thread use lib $lib_dir not working

Now I think I understood the problem. It is about the PATH searching feature which is only invoked if the script is called via "perl perlscript.pl". (Documented is a workaround to call "perl ./perlscript.pl", though. I guess I never had problems with this because I usually call scripts with the full path or at least bin/script.pl anyway.)

I was informed by Graham Barr that the PATH searching was done only because of a broken SunOS shell many years ago. I asked him because I suspected there must have been a reason for this.

Moritz and I discussed and came to the conclusion that there is no other case where this "feature" would actually be reliable and useful. So to keep the nice short usage of FindBin and to make it work correctly in all cases (except doing chdir() before, since it is actually impossible to obtain the correct path then) I submitted a report to perlbug:
http://rt.perl.org/rt3//Public/Bug/Display.html?id=89698

update: link corrected, thanks