04 Feb 2014 20:18:16 UTC
- Distribution: ylib
- Module version: 0.003
- Source (raw)
- Browse (raw)
- How to Contribute
- Repository (git clone)
- Issues (0)
- Testers (441 / 1 / 0)
- KwaliteeBus factor: 1
- 100.00% Coverage
- License: apache_2_0
- Perl: v5.6.0
- Activity24 month
- Download (14.9KB)
- MetaCPAN Explorer
- Subscribe to distribution
- This version
- Latest version
- COPYRIGHT AND LICENSE
ylib - Add paths to @INC from a config file
# in .mylib file /home/david/some/library/path # from the command line $ perl -Mylib -E 'say for @INC' /home/david/some/library/path ...
ylibmodule adds paths to
@INCfrom a configuration file named
.mylibin which each line represents a library path. The
.mylibfile can be either in the current directory and/or in the user's home directory. It is equivalent to calling
'use lib'on each path.
ylibwill issue a warning if a path in
.mylibcan't be found.
Occasionally, it's useful to customize
@INCon a per-directory basis without changing the global
PERL5LIBenvironment variable. For example, when developing or testing code that requires uninstalled code in an adjacent directory, one could create a
.mylibfile that adds the necessary path.
For example, consider this directory tree with two Perl distributions, Foo-Bar and Baz-Bam:
~/projects/ Foo-Bar/ Baz-Bam/
The code in Foo-Bar depends on code in Baz-Bam. So in Foo-Bar, create a
.mylibfile with the appropriate path:
$ cd Foo-Bar $ echo '../Baz-Bam/lib' > .mylib $ perl -Mylib Build.PL $ Build && Build test
That's easier and shorter than using
PERL5LIBon the command line, and it scales better as the number of libraries increases.
In the example above, the
@INCincluding the effect of
-Mylibwhen it was created. This is not the case with
prove, in which case,
PERL5OPTmight be an alternative approach for using
$ export PERL5OPT=-Mylib $ prove
Please report any bugs or feature requests through the issue tracker at https://github.com/dagolden/ylib/issues. You will be notified automatically of any progress on your issue.
This is open source software. The code repository is available for public review and contribution under the terms of the license.
git clone https://github.com/dagolden/ylib.git
David Golden <firstname.lastname@example.org>
This software is Copyright (c) 2014 by David Golden.
This is free software, licensed under:
The Apache License, Version 2.0, January 2004