summaryrefslogtreecommitdiff
path: root/pod
diff options
context:
space:
mode:
authorBen Cornett <ben@lantern.is>2021-07-11 15:22:22 +0000
committerLeon Timmermans <fawaka@gmail.com>2021-08-15 13:40:54 +0200
commit1c3cfd8769dc1180ad2566f695094932197a2090 (patch)
tree2ffa9abf49b249e25bbcbf41c0f9269921d98f15 /pod
parent7656d14da076307d67e322c07d470d4ce8f57474 (diff)
downloadperl-1c3cfd8769dc1180ad2566f695094932197a2090.tar.gz
Document v5.35 warnings-on-by-default
Diffstat (limited to 'pod')
-rw-r--r--pod/perl.pod9
-rw-r--r--pod/perlfunc.pod19
-rw-r--r--pod/perlintro.pod8
3 files changed, 23 insertions, 13 deletions
diff --git a/pod/perl.pod b/pod/perl.pod
index 18f8cc0baf..d9ac3e1029 100644
--- a/pod/perl.pod
+++ b/pod/perl.pod
@@ -393,10 +393,13 @@ see L<perlvar> for more information.
Using the C<use strict> pragma ensures that all variables are properly
declared and prevents other misuses of legacy Perl features.
+These are enabled by default within the scope of
+C<L<use v5.12|perlfunc/use VERSION>> (or higher).
-The C<use warnings> pragma produces some lovely diagnostics. One can
-also use the B<-w> flag, but its use is normally discouraged, because
-it gets applied to all executed Perl code, including that not under
+The C<use warnings> pragma produces some lovely diagnostics.
+It is enabled by default when you say C<use v5.35> (or higher).
+One can also use the B<-w> flag, but its use is normally discouraged,
+because it gets applied to all executed Perl code, including that not under
your control.
See L<perldiag> for explanations of all Perl's diagnostics. The C<use
diff --git a/pod/perlfunc.pod b/pod/perlfunc.pod
index 2fe7404fc9..8227969f4f 100644
--- a/pod/perlfunc.pod
+++ b/pod/perlfunc.pod
@@ -9638,18 +9638,19 @@ L<C<use>|/use Module VERSION LIST>ing library modules that won't work
with older versions of Perl.
(We try not to do this more than we have to.)
-C<use VERSION> also lexically enables all features available in the requested
+C<use VERSION> lexically enables all features available in the requested
version as defined by the L<feature> pragma, disabling any features
not in the requested version's feature bundle. See L<feature>.
-Similarly, if the specified Perl version is greater than or equal to
+If the specified Perl version is greater than or equal to
5.12.0, strictures are enabled lexically as
-with L<C<use strict>|strict>. Any explicit use of
-C<use strict> or C<no strict> overrides C<use VERSION>, even if it comes
-before it. Later use of C<use VERSION>
-will override all behavior of a previous
-C<use VERSION>, possibly removing the C<strict> and C<feature> added by
-C<use VERSION>. C<use VERSION> does not
-load the F<feature.pm> or F<strict.pm>
+with L<C<use strict>|strict>.
+Similarly, L<warnings> are enabled if C<VERSION> is 5.35.0 or higher.
+Any explicit use of C<use strict> or C<no strict> overrides C<use VERSION>,
+even if it comes before it.
+Later use of C<use VERSION> will override all behavior of a previous
+C<use VERSION>, possibly removing the C<strict>, C<warnings>, and C<feature>
+added by C<use VERSION>. C<use VERSION> does not
+load the F<feature.pm>, F<strict.pm>, or F<warnings.pm>
files.
The C<BEGIN> forces the L<C<require>|/require VERSION> and
diff --git a/pod/perlintro.pod b/pod/perlintro.pod
index c4a6d758f6..a56c4989e6 100644
--- a/pod/perlintro.pod
+++ b/pod/perlintro.pod
@@ -93,9 +93,15 @@ problems in your code. They check different things so you need both. A
potential problem caught by C<use strict;> will cause your code to stop
immediately when it is encountered, while C<use warnings;> will merely
give a warning (like the command-line switch B<-w>) and let your code run.
-To read more about them check their respective manual pages at L<strict>
+To read more about them, check their respective manual pages at L<strict>
and L<warnings>.
+A C<L<use v5.35|perlfunc/use VERSION>> (or higher) declaration will
+enable both C<strict> and C<warnings>:
+
+ #!/usr/bin/perl
+ use v5.35;
+
=head2 Basic syntax overview
A Perl script or program consists of one or more statements. These