more warnings tidy-ups (from Paul Marquess)
authorGurusamy Sarathy <gsar@cpan.org>
Tue, 14 Mar 2000 22:44:27 +0000 (22:44 +0000)
committerGurusamy Sarathy <gsar@cpan.org>
Tue, 14 Mar 2000 22:44:27 +0000 (22:44 +0000)
p4raw-id: //depot/perl@5747

pod/perldelta.pod
pod/perldiag.pod
pod/perlfaq4.pod
t/lib/attrs.t
utils/h2xs.PL

index b8eaa47..361dcc4 100644 (file)
@@ -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.
index 8701714..d57e7e5 100644 (file)
@@ -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
index b8ccfba..e997a8f 100644 (file)
@@ -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:
index d8afbf6..eb8c8c4 100644 (file)
@@ -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
 
index 50b15d1..033ad02 100644 (file)
@@ -646,6 +646,7 @@ package $module;
 
 require 5.005_62;
 use strict;
+use warnings;
 END
 
 unless( $opt_X || $opt_c || $opt_A ){