develooper Front page | perl.perl5.porters | Postings from March 2007

[PATCH] inform constant.pm about UNITCHECK

Thread Next
From:
Joshua ben Jore
Date:
March 13, 2007 00:35
Subject:
[PATCH] inform constant.pm about UNITCHECK
Message ID:
dc5c751d0703130035o1a739f45g1ea559d110bd5dd8@mail.gmail.com
The following patch adds the UNITCHECK name to the list of barewords
that constant.pm warns about.

Josh

diff -wuru bleadperl/lib/constant.pm myblead/lib/constant.pm
--- bleadperl/lib/constant.pm   2007-02-13 06:23:21.000000000 -0800
+++ myblead/lib/constant.pm     2007-03-12 23:56:12.000000000 -0700
@@ -5,12 +5,12 @@
 use warnings::register;

 our($VERSION, %declared);
-$VERSION = '1.08';
+$VERSION = '1.09';

 #=======================================================================

 # Some names are evil choices.
-my %keywords = map +($_, 1), qw{ BEGIN INIT CHECK END DESTROY AUTOLOAD };
+my %keywords = map +($_, 1), qw{ BEGIN INIT CHECK UNITCHECK END
DESTROY AUTOLOAD };

 my %forced_into_main = map +($_, 1),
     qw{ STDIN STDOUT STDERR ARGV ARGVOUT ENV INC SIG };
Only in myblead/lib: constant.pm.~1~
diff -wuru bleadperl/lib/constant.t myblead/lib/constant.t
--- bleadperl/lib/constant.t    2006-06-13 12:29:21.000000000 -0700
+++ myblead/lib/constant.t      2007-03-12 23:52:16.000000000 -0700
@@ -14,7 +14,7 @@


 use strict;
-use Test::More tests => 95;
+use Test::More tests => 96;
 my $TB = Test::More->builder;

 BEGIN { use_ok('constant'); }
@@ -182,6 +182,7 @@
     use constant 'BEGIN' => 1 ;
     use constant 'INIT' => 1 ;
     use constant 'CHECK' => 1 ;
+    use constant 'UNITCHECK' => 1;
     use constant 'END' => 1 ;
     use constant 'DESTROY' => 1 ;
     use constant 'AUTOLOAD' => 1 ;
@@ -195,13 +196,15 @@
     use constant 'SIG' => 1 ;
 };

-is @warnings, 15 ;
+is @warnings, 16 ;
+
 my @Expected_Warnings =
   (
    qr/^Constant name 'BEGIN' is a Perl keyword at/,
    qr/^Constant subroutine BEGIN redefined at/,
    qr/^Constant name 'INIT' is a Perl keyword at/,
    qr/^Constant name 'CHECK' is a Perl keyword at/,
+   qr/^Constant name 'UNITCHECK' is a Perl keyword at/,
    qr/^Constant name 'END' is a Perl keyword at/,
    qr/^Constant name 'DESTROY' is a Perl keyword at/,
    qr/^Constant name 'AUTOLOAD' is a Perl keyword at/,

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