Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.3 / 3....
  • LibreOffice 3.6.6 / 4.0.3
  • MPlayer 1.1.1
  • systemd 204
  • Arch Linux 2013.05.01
  • Blender 2.67
  • KDE Software Compilatio...
  • CrunchBang Linux Stable...
  • Elementary OS 0.1 / 0.2...
  • SystemRescueCd 3.6.0
  • Home > Linux > Programming > Perl Modules

    lib::abs 0.91

    Download button

    No screenshots available
    Downloads: 275  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Mons Anderson | More programs
    Perl Artistic License / FREE
    March 12th, 2010, 05:14 GMT
    ROOT / Programming / Perl Modules

     Read user reviews (0)  Refer to a friend  Subscribe

    lib::abs description

    The same as lib, but makes relative path absolute

    lib::abs' main reason is to transformate relative paths to absolute at the BEGIN stage, and push transformed to @INC. Relative path basis is not the current working directory, but the location of file, where the statement is (caller file). When using common lib, relative paths stays relative to curernt working directory,

     # For ex:
     # script: /opt/scripts/my.pl
     use lib::abs '../lib';

     # We run `/opt/scripts/my.pl` having cwd /home/mons
     # The @INC will contain '/opt/lib';

     # We run `./my.pl` having cwd /opt
     # The @INC will contain '/opt/lib';

     # We run `../my.pl` having cwd /opt/lib
     # The @INC will contain '/opt/lib';


    Also this module is useful when writing tests, when you want to load strictly the module from ../lib, respecting the test file.

     # t/00-test.t
     use lib::abs '../lib';


    Also this is useful, when you running under mod_perl, use something like Apache::StatINC, and your application may change working directory. So in case of chdir StatINC fails to reload module if the @INC contain relative paths.

    SYNOPSIS

    Simple use like use lib ...:

     use lib::abs qw(./mylibs1 ../mylibs2);
     use lib::abs 'mylibs';


    Extended syntax (glob)

     use lib::abs 'modules/*/lib';

    There are also may be used helper function from lib::abs (see example/ex4):

     use lib::abs;
     # ...
     my $path = lib::abs::path('../path/relative/to/me'); # returns absolute path



    Product's homepage

    Requirements:

    · Perl

      


    TAGS:

    relative path | absolute path | Perl module | relative | absolute | path

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM