FindBin::libs

FindBin::libs - Locate and 'use lib' directories along the path of $FindBin::Bin to automate locating modules.
Download

FindBin::libs Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Steven Lembark
  • Publisher web site:
  • http://search.cpan.org/~lembark/

FindBin::libs Tags


FindBin::libs Description

FindBin::libs - Locate and 'use lib' directories along the path of $FindBin::Bin to automate locating modules. FindBin::libs is a Perl module used to locate and 'use lib' directories along the path of $FindBin::Bin to automate locating modules. Uses File::Spec and Cwd's abs_path to accomodate multiple O/S and redundant symlinks.SYNOPSIS # search up $FindBin::Bin looking for ./lib directories # and "use lib" them. use FindBin::libs; # same as above with explicit defaults. use FindBin::libs qw( base=lib use noexport noprint ); # print the lib dir's before using them. use FindBin::libs qw( print ); # find and use lib "altlib" dir's use FindBin::libs qw( base=altlib ); # move starting point from $FindBin::Bin to '/tmp' use FindBin::libs qw( Bin=/tmp base=altlib ); # skip "use lib", export "@altlib" instead. use FindBin::libs qw( base=altlib export ); # find altlib directories, use lib them and export @mylibs use FindBin::libs qw( base=altlib export=mylibs use ); # "export" defaults to "nouse", these two are identical: use FindBin::libs qw( export nouse ); use FindBin::libs qw( export ); # use and export are not exclusive: use FindBin::libs qw( use export ); # do both use FindBin::libs qw( nouse noexport print ); # print only use FindBin::libs qw( nouse noexport ); # do nothting at all # print a few interesting messages about the # items found. use FindBinlibs qw( verbose ); # turn on a breakpoint after the args are prcoessed, before # any search/export/use lib is handled. use FindBin::libs qw( debug ); # prefix PERL5LIB with the lib's found. use FindBin::libs qw( perl5lib ); # find a subdir of the lib's looked for. # the first example will use both ../lib and # ../lib/perl5; the second ../lib/perl5/frobnicate # (if they exist). it can also be used with export # and base to locate special configuration dir's. # # subonly with a base is useful for locating config # files. this finds any "./config/mypackage" dir's # without including any ./config dir's. the result # ends up in @config (see also "export=", above). use FindBin::libs qw( subdir=perl5 ); use FindBin::libs qw( subdir=perl5/frobnicate ); use FindBin::libs qw( base=config subdir=mypackage subonly export );General UseThis module will locate directories along the path to $FindBin::Bin and "use lib" or export an array of the directories found. The default is to locate "lib" directories and "use lib" them without printing the list.Options controll whether the lib's found are exported into the caller's space, exported to PERL5LIB, or printed. Exporting or setting perl5lib will turn off the default of "use lib" so that: use FindBin::libs qw( export ); use FindBin::libs qw( p5lib );are equivalent to use FindBin::libs qw( export nouse ); use FindBin::libs qw( p5lib nouse );Combining export with use or p5lib may be useful, p5lib and use are probably not all that useful together. Requirements: · Perl


FindBin::libs Related Software