From: Nicholas Clark Date: Tue, 9 Jan 2007 21:37:31 +0000 (+0000) Subject: Make keywords.pl strict and warnings clean. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=eada5d412b7a767990239a3620a5cffcd3543384;p=p5sagit%2Fp5-mst-13.2.git Make keywords.pl strict and warnings clean. p4raw-id: //depot/perl@29739 --- diff --git a/keywords.pl b/keywords.pl index f233b6a..d702a1a 100755 --- a/keywords.pl +++ b/keywords.pl @@ -1,4 +1,5 @@ -#!/usr/bin/perl +#!/usr/bin/perl -w +use strict; require 'regen_lib.pl'; safer_unlink ("keywords.h"); @@ -25,12 +26,12 @@ EOM # Read & print data. -$keynum = 0; +my $keynum = 0; while () { 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; }