develooper Front page | perl.perl5.porters | Postings from September 2018

[perl #133522] 'no lib' does not documents that it also checks$dir/$version

Thread Previous | Thread Next
From:
James E Keenan via RT
Date:
September 18, 2018 02:53
Subject:
[perl #133522] 'no lib' does not documents that it also checks$dir/$version
Message ID:
rt-4.0.24-21157-1537239188-1600.133522-15-0@perl.org
On Mon, 17 Sep 2018 09:21:16 GMT, kes-kes@yandex.ru wrote:
> Subject: 'no lib' does not documents that it also checks $dir/$version
> Message-Id: <5.24.1_12735_1537175568@work>
> Cc: kes-kes@yandex.ru
> To: perlbug@perl.org
> From: kes-kes@yandex.ru
> Reply-To: kes-kes@yandex.ru
> 
> 
> This is a bug report for perl from kes-kes@yandex.ru,
> generated with the help of perlbug 1.40 running under perl 5.24.1.
> 
> 
> -----------------------------------------------------------------
> [Please describe your issue here]
> 
> The [documentation](http://perldoc.perl.org/lib.html) for `lib` module
> says:
> 
> > also checks if directories called $dir/$version and
> > $dir/$version/$archname
> exist and adds these directories to @INC.
> 
> When we 'use lib $dir'
> 
> But does it do same check when we use 'no lib $dir'. I may suppose it
> does.
> To be sure it must be documented. Now it does not:
> 
> > For each directory in LIST (called $dir here) the lib module also
> > checks to
> see if a directory called $dir/$archname/auto exists. If so the
> $dir/$archname
> directory is assumed to be a corresponding architecture specific
> directory and
> is also deleted from @INC.
> 
> 

But note what the documentation for 'use lib' does *not* say.  It makes no claim that either 'use lib' or 'no lib' checks for the existence of $dir.  'use lib' will push $dir onto @INC whether it exists or not.  (See attached 133522-no-lib.pl.)  If $dir does not exist, then by definition directory "$dir/<archname>/auto" doesn't exist either.

-- 
James E Keenan (jkeenan@cpan.org)

---
via perlbug:  queue: perl5 status: new
https://rt.perl.org/Ticket/Display.html?id=133522

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About