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

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':
use File::Basename; use Cwd 'abs_path'; BEGIN { unshift(@INC, abs_path(dirname($0).'/../lib')); };
Question: Is there a standard module which does this? It would be nice if one could write something like:
use rellib '../lib';
instead of that boilerplate mess above.

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.