Dist-HomeDir
view release on metacpan or search on metacpan
DO NOT use this in code that is ever likely to be installed via cpan or
other package manager.
DESCRIPTION
This module was inspired by Catalyst::Utils->home() to obtain the root
directory for obtaining application code and self-contained support
data in directories relative to the distribution root. It does this by
returning a Path::Tiny object which has a very nice interface. However
Catalyst::Utils->home only works for perl classes. This works for class
files and perl scripts via examining (caller)[1] and thus should never
be used in code that will be instaled via a cpan client or other
package manager.
Sometimes support libaries will also live in the t/lib directory and
the script/lib directory. dist_home will ignore these lib directories
as part of finding the distribution root. Future versions of this
module may make the list of what directories to ignore other lib sub
directories user-configurable (patches welcome).
If you want to modify @INC with the import syntax in the second example
lib/Dist/HomeDir.pm view on Meta::CPAN
DO NOT use this in code that is B<ever> likely to be installed via cpan
or other package manager.
=head2 DESCRIPTION
This module was inspired by Catalyst::Utils->home() to obtain the root
directory for obtaining application code and self-contained support data in
directories relative to the distribution root. It does this by returning a
L<Path::Tiny> object which has a very nice interface. However
Catalyst::Utils->home only works for perl classes. This works for class
files and perl scripts via examining C<(caller)[1]> and thus should
B<never> be used in code that will be instaled via a cpan client or other
package manager.
Sometimes support libaries will also live in the C<t/lib> directory and the
C<script/lib> directory. C<dist_home> will ignore these C<lib> directories
as part of finding the distribution root. Future versions of this module
may make the list of what directories to ignore other C<lib> sub directories
user-configurable (patches welcome).
If you want to modify C<@INC> with the import syntax in the second example
( run in 1.807 second using v1.01-cache-2.11-cpan-1e74a51a04c )