The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

lib::xi - Installs missing modules on demand

VERSION

This document describes lib::xi version 0.03.

SYNOPSIS

    # 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

DESCRIPTION

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.

lib::xi is a pragma to install missing libraries if and only if they are required.

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.

INTERFACE

The import method

use lib::xi ?$install_dir, ?@cpanm_opts

Setups the lib::xi hook into @INC.

If $install_dir is specified, it is used as the install directory as cpanm --loca-lib $install_dir.

If the first argument starts -, it is regarded as @cpanm_opts.

See perldoc -f require for the @INC hook specification details.

DEPENDENCIES

Perl 5.8.1 or later.

BUGS

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.

SEE ALSO

cpanm (App::cpanminus)

AUTHOR

Fuji, Goro (gfx) <gfuji@cpan.org>

LICENSE AND COPYRIGHT

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.