http://www.perlmonks.org?node_id=268162


in reply to Utility of "use lib qw{ . }" ?

. will be the last element of @INC which means that all though it will always be checked, it will be the last path checked for any modules.
if you call
use lib '.';
. will be unshifted onto the front of @INC which means it will be checked first so you know that any modules in the current path will take precedence.

Replies are listed 'Best First'.
(jeffa) 2Re: Utility of "use lib qw{ . }" ?
by jeffa (Bishop) on Jun 23, 2003 at 14:30 UTC
    Exactly. I just wanted to follow this up with a demonstration that everyone can try at home:
    perl -le"print for @INC" perl -Mlib=. -le"print for @INC"
    Notice the placement of .

    jeffa

    L-LL-L--L-LL-L--L-LL-L--
    -R--R-RR-R--R-RR-R--R-RR
    B--B--B--B--B--B--B--B--
    H---H---H---H---H---H---
    (the triplet paradiddle with high-hat)