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

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

Thread Previous | Thread Next
From:
Dan Book
Date:
January 24, 2018 17:38
Subject:
Re: [perl #132732] use if - behaviour does not match documentation
Message ID:
CABMkAVUKxoSbCxPrsFR9ZcoEWPfO_ZwuB0QyFsq6jp1OGzyycw@mail.gmail.com
On Wed, Jan 24, 2018 at 12:33 PM, James E Keenan <jkeenan@pobox.com> wrote:

> On 01/24/2018 12:20 PM, Dan Book wrote:
>
>>  From the source code, 'no if' appears to do the same thing as 'use if'
>> but runs unimport instead of import. It's not a negation of the condition.
>> This is consistent with 'no' and 'use' but the negation is not explained
>> very well IMO.
>>
>>
> So, would a proper test then be to import specific functions, then use 'no
> if CONDITION, "MODULE" ARGUMENTS to unimport them?
>
>
That should be reasonable, but note that not many modules implement
unimport; 'no warnings' is probably the most common usage of 'no'.

-Dan

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