lib::xi - Installs missing modules on demand
This document describes lib::xi version 0.03.
# to install missing libaries $ perl -Mlib::xi script.pl # to install missing libaries to extlib/ (with cpanm -l extlib) $ perl -Mlib::xi=extlib script.pl # extlib with cpanm options $ perl -Mlib::xi=extlib,-q script.pl # with cpanm options $ perl -Mlib::xi=-L,extlib,-q script.pl
When you execute a script found in, for example, gist, you'll be annoyed at missing libraries and will install those libraries by hand with a CPAN client. We have repeated such a task but it violates the great virtue of Laziness.
gist
lib::xi is a pragma to install missing libraries if and only if they are required.
lib::xi
The mechanism is that if perl interpreter cannot find the library to be loaded, this pragma try to install it with cpanm and tell it to the interpreter.
cpanm
use lib::xi ?$install_dir, ?@cpanm_opts
Setups the lib::xi hook into @INC.
@INC
If $install_dir is specified, it is used as the install directory as cpanm --loca-lib $install_dir.
$install_dir
cpanm --loca-lib $install_dir
If the first argument starts -, it is regarded as @cpanm_opts.
-
@cpanm_opts
See perldoc -f require for the @INC hook specification details.
perldoc -f require
Perl 5.8.1 or later.
All complex software has bugs lurking in it, and this module is no exception. If you find a bug please either email me, or add the bug to cpan-RT.
cpanm (App::cpanminus)
Fuji, Goro (gfx) <gfuji@cpan.org>
Copyright (c) 2011, Fuji, Goro (gfx). All rights reserved.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install lib::xi, copy and paste the appropriate command in to your terminal.
cpanm lib::xi
CPAN shell
perl -MCPAN -e shell install lib::xi
For more information on module installation, please visit the detailed CPAN module installation guide.