You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by rj...@apache.org on 2018/09/20 09:32:35 UTC

svn commit: r1841451 - /tomcat/jk/trunk/tools/lineends.pl

Author: rjung
Date: Thu Sep 20 09:32:35 2018
New Revision: 1841451

URL: http://svn.apache.org/viewvc?rev=1841451&view=rev
Log:
Use perl strict mode.

Modified:
    tomcat/jk/trunk/tools/lineends.pl

Modified: tomcat/jk/trunk/tools/lineends.pl
URL: http://svn.apache.org/viewvc/tomcat/jk/trunk/tools/lineends.pl?rev=1841451&r1=1841450&r2=1841451&view=diff
==============================================================================
--- tomcat/jk/trunk/tools/lineends.pl (original)
+++ tomcat/jk/trunk/tools/lineends.pl Thu Sep 20 09:32:35 2018
@@ -28,12 +28,14 @@
 #  Todo: Handle NULL stdin characters gracefully.
 #
 
+use strict;
+
 use IO::File;
 use File::Find;
 
 # The ignore list is '-' seperated, with this leading hyphen and
 # trailing hyphens in ever concatinated list below.
-$ignore = "-";
+my $ignore = "-";
 
 # Image formats
 $ignore .= "gif-jpg-jpeg-png-ico-bmp-";
@@ -53,13 +55,13 @@ $ignore .= "class-so-dll-exe-obj-a-o-lo-
 # Some build env files
 $ignore .= "mcp-xdc-ncb-opt-pdb-ilk-sbr-";
 
-$preservedate = 1;
+my $preservedate = 1;
 
-$forceending = 0;
+my $forceending = 0;
 
-$givenpaths = 0;
+my $givenpaths = 0;
 
-$notnative = 0;
+my $notnative = 0;
 
 while (defined $ARGV[0]) {
     if ($ARGV[0] eq '--touch') {
@@ -105,22 +107,24 @@ if (!$givenpaths) {
 }
 
 sub totxt {
-        $oname = $_;
-        $tname = '.#' . $_;
+        my $oname = $_;
+        my $tname = '.#' . $_;
         if (!-f) {
             return;
         }
-        @exts = split /\./;
+        my @exts = split /\./;
         if ($forceending < 2) {
+            my $ext;
             while ($#exts && ($ext = pop(@exts))) {
                 if ($ignore =~ m|-$ext-|i) {
                     return;
                 }
             }
         }
-        @ostat = stat($oname);
-        $srcfl = new IO::File $oname, "r" or die;
-        $dstfl = new IO::File $tname, "w" or die;
+        my @ostat = stat($oname);
+        my $srcfl = new IO::File $oname, "r" or die;
+        my $dstfl = new IO::File $tname, "w" or die;
+        my ($t, $n);
         binmode $srcfl; 
         if ($notnative) {
             binmode $dstfl;
@@ -151,7 +155,7 @@ sub totxt {
         if (defined $t) {
             unlink $oname or die;
             rename $tname, $oname or die;
-            @anames = ($oname);
+            my @anames = ($oname);
             if ($preservedate) {
                 utime $ostat[9], $ostat[9], @anames;
             }



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org