inc - Add Named Resources to @INC


inc documentation Contained in the inc distribution.

Index


Code Index:

NAME

Top

inc - Add Named Resources to @INC

SYNOPSIS

Top

    use inc 'Plagger';   # Make sure @INC uses the Plagger deps install tree

DESCRIPTION

Top

inc is a module to add named Perl module install paths to @INC, in a concise, generic and portable way.

It is meant for projects that take advantage of external dependency trees like those provided by PMIR.

NOTE

Top

This module is in its infancy. Please don't use it yet.

AUTHOR

Top

Ingy döt Net <ingy@cpan.org>

COPYRIGHT

Top


inc documentation Contained in the inc distribution.

package inc;
use 5.005003;
use strict;
use File::Spec;
$inc::VERSION = '0.01';

sub import {
    my $class = shift;
    my $name = shift;
    return unless $name;
    my $base;
    if ($base = $ENV{PERL_INC_BASE}) {
        use_lib(File::Spec->catfile($base, $name));
    }
}

sub use_lib {
    my $base = File::Spec->canonpath(shift);
    eval "use lib '$base'; 1" or die $@;
}

1;