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

Re: [perl #132732] use if - behaviour does not match documentation

Thread Previous | Thread Next
Dan Book
January 25, 2018 00:54
Re: [perl #132732] use if - behaviour does not match documentation
Message ID:
On Wed, Jan 24, 2018 at 4:18 PM, James E Keenan via RT <> wrote:

> On Wed, 24 Jan 2018 17:38:14 GMT, wrote:
> > >
> > >
> > That should be reasonable, but note that not many modules implement
> > unimport; 'no warnings' is probably the most common usage of 'no'.
> >
> > -Dan
> There are many instances of the 'no' function in the source code, but very
> few instances of the string 'no if'.  See attachment for output of 'ack
> '\bno\s+if\b' .'.  Almost every instance is testing one of Perl's special
> variables against some value and, as you say, most are warnings-related.
> Unfortunately that isn't getting us any close to solving the problem.  Is
> anyone familiar with where/how 'no' is implemented in the source code?
'no' is the same as 'use' but it calls unimport instead of import. The
complications just come from modules not generally implementing an unimport
method that mirrors the import (mostly because unimporting functions
doesn't really make practical sense). So only pragmas that create lexical
effects tend to use it.


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About