develooper Front page | perl.perl5.porters | Postings from October 2014

[perl #122881] [PATCH] Clarify 'use VERSION' documentation

Thread Previous | Thread Next
Doug Bell
October 2, 2014 13:14
[perl #122881] [PATCH] Clarify 'use VERSION' documentation
Message ID:
# New Ticket Created by  Doug Bell 
# Please include the string:  [perl #122881]
# in the subject line of all future correspondence about this issue. 
# <URL: >

A coworker came to me with some questions about 'use VERSION' and how it enables strict and features. After a bunch of testing and a bit of confusion, we figured out the docs were slightly misleading.

The docs say "Any explicit use of C<use strict> or C<no strict> overrides C<use VERSION>, even if it comes before it." but our tests say:

    perl -e'no strict "vars"; use 5.012; $foo' # lives because no strict overrides use VERSION as desired
    perl -e'use strict "refs"; use 5.012; $foo' # dies because use VERSION turned on the rest of strict

The core tests (t/comp/use.t) confirm that this is expected behavior.

The docs then say that "In both cases, the F<> and F<> files are not actually loaded."

Though use VERSION does not load or, any explicit use of or (use or no) must load the files. use VERSION does not prevent or from getting loaded later.

I've attached patches for these two things.

Additionally, I got tripped up by the use of the word "strictures", since there is now a CPAN The word is used about 20 times in core, so it's not much effort to change, but I'm not sure that core should change what it labels things because of CPAN. With approval, I could change it to just "strict", despite being ungrammatical in places. Alternatively, "strictness", though "strict" has the benefit of not being able to be taken by someone else on CPAN. Also, I'd like a hot pink bike shed.

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