perl5ever has asked for the wisdom of the Perl Monks concerning the following question:
Lately I've been finding myself adding library directories which are relative to $0. For instance, if the program '.../bin/foo' needs to use pm files in '.../lib', I'll have this at the beginning of 'foo':
Question: Is there a standard module which does this? It would be nice if one could write something like:use File::Basename; use Cwd 'abs_path'; BEGIN { unshift(@INC, abs_path(dirname($0).'/../lib')); };
instead of that boilerplate mess above.use rellib '../lib';
If not, has a module which does this ever been considered for inclusion as a standard module?
Naturally, such a module could be made to work like 'use lib' in that it would include arch specific directories if they exist.
Back to
Seekers of Perl Wisdom