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

NAME

lib::vendor - add vendor libraries to the module search path (@INC)

VERSION

version 0.14.163

SYNOPSIS

  # Include only $FindBin::RealBin/../lib in module search path (@INC).
  use lib::vendor;

or

  # Include in module search path (@INC):
  # $FindBin::RealBin/../lib,
  # $FindBin::RealBin/../vendor/core/lib 
  use lib::vendor qw(core);

or

  # Include in module search path (@INC):
  # $FindBin::RealBin/../lib,
  # $FindBin::RealBin/../vendor/core/lib,
  # $FindBin::RealBin/../vendor/common/lib,
  # $FindBin::RealBin/../vendor/mongodb/lib,
  # $FindBin::RealBin/../vendor/rabbitmq/lib
  use lib::vendor qw(core common mongodb rabbitmq);

or

  # Do nothing
  use lib::vendor ();

DESCRIPTION

Locates the full path to the script home and adds its lib directory to the library search path, plus any vendor library directories specified.

The script home is the directory closest to the original script which has a lib subdirectory. It first searches the directory that the script was executed from, then upwards until it finds a directory containing a lib subdirectory.

There is an optional configuration value of -vendor, which will configure what the vendor directory is.

  use lib::vendor -vendor => 'include', qw( this that );
  # Include in module search path (@INC):
  # $FindBin::RealBin/../lib,
  # $FindBin::RealBin/../include/this,
  # $FindBin::RealBin/../include/that

  use lib::vendor -vendor => '', qw( this that );
  # Include in module search path (@INC):
  # $FindBin::RealBin/../lib,
  # $FindBin::RealBin/../this,
  # $FindBin::RealBin/../that

BUGS

Please report any bugs or feature requests on the bugtracker website https://github.com/rkleemann/lib-vendor/issues or by email to bug-lib-vendor@rt.cpan.org.

When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.

SEE ALSO

lib, mylib, FindBin

AUTHOR

Bob Kleemann <bobk@cpan.org>

COPYRIGHT AND LICENSE

This software is Copyright (c) 2014 by Bob Kleemann.

This is free software, licensed under:

  The Artistic License 2.0 (GPL Compatible)