diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 2000-03-14 22:44:27 +0000 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 2000-03-14 22:44:27 +0000 |
commit | 8cd7955893792dd3ae9bfaf61ca10fa3182273ac (patch) | |
tree | 31e77f9a2cac8345acb2320739e438eee3877e3e | |
parent | b193a46a487da8f58988b6f01ca123407b8fda72 (diff) | |
download | perl-8cd7955893792dd3ae9bfaf61ca10fa3182273ac.tar.gz |
more warnings tidy-ups (from Paul Marquess)
p4raw-id: //depot/perl@5747
-rw-r--r-- | pod/perldelta.pod | 19 | ||||
-rw-r--r-- | pod/perldiag.pod | 18 | ||||
-rw-r--r-- | pod/perlfaq4.pod | 4 | ||||
-rw-r--r-- | t/lib/attrs.t | 13 | ||||
-rw-r--r-- | utils/h2xs.PL | 1 |
5 files changed, 52 insertions, 3 deletions
diff --git a/pod/perldelta.pod b/pod/perldelta.pod index b8eaa47d70..361dcc43eb 100644 --- a/pod/perldelta.pod +++ b/pod/perldelta.pod @@ -2443,6 +2443,25 @@ Remember that "my", "our", and "local" bind tighter than comma. (W) You are concatenating the number 19 with another number, which could be a potential Year 2000 problem. +=item pragma "attrs" is deprecated, use "sub NAME : ATTRS" instead + +(W) You have written somehing like this: + + sub doit + { + use attrs qw(locked); + } + +You should use the new declaration syntax instead. + + sub doit : locked + { + ... + +The C<use attrs> pragma is now obsolete, and is only provided for +backward-compatibility. See L<perlsub/"Subroutine Attributes">. + + =item Premature end of script headers See Server error. diff --git a/pod/perldiag.pod b/pod/perldiag.pod index 87017145d2..d57e7e57a3 100644 --- a/pod/perldiag.pod +++ b/pod/perldiag.pod @@ -2529,6 +2529,24 @@ Perl guesses a reasonable buffer size, but puts a sentinel byte at the end of the buffer just in case. This sentinel byte got clobbered, and Perl assumes that memory is now corrupted. See L<perlfunc/ioctl>. +=item pragma "attrs" is deprecated, use "sub NAME : ATTRS" instead + +(W deprecated) You have written somehing like this: + + sub doit + { + use attrs qw(locked); + } + +You should use the new declaration syntax instead. + + sub doit : locked + { + ... + +The C<use attrs> pragma is now obsolete, and is only provided for +backward-compatibility. See L<perlsub/"Subroutine Attributes">. + =item Precedence problem: open %s should be open(%s) (S precedence) The old irregular construct diff --git a/pod/perlfaq4.pod b/pod/perlfaq4.pod index b8ccfba847..e997a8fcb9 100644 --- a/pod/perlfaq4.pod +++ b/pod/perlfaq4.pod @@ -446,9 +446,7 @@ parser. If you are serious about writing a parser, there are a number of modules or oddities that will make your life a lot easier. There are the CPAN modules Parse::RecDescent, Parse::Yapp, and Text::Balanced; -the byacc program; and Mark-Jason -Dominus's excellent I<py> tool at http://www.plover.com/%7Emjd/perl/py/ -. +and the byacc program. One simple destructive, inside-out approach that you might try is to pull out the smallest nesting parts one at a time: diff --git a/t/lib/attrs.t b/t/lib/attrs.t index d8afbf635a..eb8c8c4a1a 100644 --- a/t/lib/attrs.t +++ b/t/lib/attrs.t @@ -117,6 +117,19 @@ unless ($@ && $@ =~ m/Invalid separator character '[+]' in attribute list at/) { print "ok ",++$test,"\n"; BEGIN {++$ntests} +{ + my $w = "" ; + local $SIG{__WARN__} = sub {$w = @_[0]} ; + eval 'sub w1 ($) { use warnings "deprecated"; use attrs "locked"; $_[0]++ }'; + (print "not "), $failed=1 if $@; + print "ok ",++$test,"\n"; + BEGIN {++$ntests} + (print "not "), $failed=1 + if $w !~ /^pragma "attrs" is deprecated, use "sub NAME : ATTRS" instead at/; + print "ok ",++$test,"\n"; + BEGIN {++$ntests} +} + # Other tests should be added above this line diff --git a/utils/h2xs.PL b/utils/h2xs.PL index 50b15d130c..033ad02528 100644 --- a/utils/h2xs.PL +++ b/utils/h2xs.PL @@ -646,6 +646,7 @@ package $module; require 5.005_62; use strict; +use warnings; END unless( $opt_X || $opt_c || $opt_A ){ |