This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Code comments, by Brandon Black
[perl5.git] / keywords.pl
index fa8a282..d702a1a 100755 (executable)
@@ -1,4 +1,5 @@
-#!/usr/bin/perl
+#!/usr/bin/perl -w
+use strict;
 
 require 'regen_lib.pl';
 safer_unlink ("keywords.h");
@@ -12,7 +13,7 @@ print <<EOM;
  *    keywords.h
  *
  *    Copyright (C) 1994, 1995, 1996, 1997, 1999, 2000, 2001, 2002, 2005,
- *    2006, by Larry Wall and others
+ *    2006, 2007, by Larry Wall and others
  *
  *    You may distribute under the terms of either the GNU General Public
  *    License or the Artistic License, as specified in the README file.
@@ -25,12 +26,12 @@ EOM
 
 # Read & print data.
 
-$keynum = 0;
+my $keynum = 0;
 while (<DATA>) {
     chop;
     next unless $_;
     next if /^#/;
-    ($keyword) = split;
+    my ($keyword) = split;
     print &tab(5, "#define KEY_$keyword"), $keynum++, "\n";
 }
 
@@ -40,7 +41,7 @@ close KW or die "Error closing keywords.h: $!";
 
 ###########################################################################
 sub tab {
-    local($l, $t) = @_;
+    my ($l, $t) = @_;
     $t .= "\t" x ($l - (length($t) + 1) / 8);
     $t;
 }