NAME
ful - a useful "find upper lib" pragma that ascends dirs to include module directories in @INC
.
SYNOPSIS
One line to rule them all.
use
ful;
Within a-script.pl
when your project looks like this:
project-root/
├── bin/
│ └── utils/
│ └── a-script.pl
├── lib/
├── vendor/
│ └── SomeOrg/
│ └── Some/
│ └── Module.pm
And that's it.
And if you need more than just the project-root/lib
dir, you can do this:
Instead of:
# or
use
FindBin;
# or even
BEGIN {
my
$base
= path(__FILE__)->parent;
$base
=
$base
->parent
until
-d
"$base/lib"
or
$base
->is_rootdir;
unshift
@INC
,
"$base/lib"
,
"$base/vendor"
;
}
VERSION
0.04
SUPPORT
Support is by the author. Please file bug reports or ask questions at https://github.com/ryan-willis/p5-ful/issues.