Commits

Shlomi Fish committed 5394a17

Got rid of some warnings.

Comments (0)

Files changed (1)

src/wml_docs/wml_tags.pod.pl

     'dest=s' => \$dest,
     'main=s' => \$main,
     'incl=s' => \$incl,
-) or "Die! Wrong parameters!";
+) or die "Wrong parameters!";
 
 open my $out_fh, '>', $dest
     or die "Cannot open output_file '$dest'. $!";
     or die "Cannot open input_file '$src'. $!";
 
 my (@L);
-while (<$in_fh>) {
-    if (m|^%%CORE%%|) {
+while (my $line = <$in_fh>) {
+    if ($line =~ m|^%%CORE%%|) {
         open( my $tmp_fh, '<', $main)
             or die "Cannot open main file - '$main' - $!";
         @L = ();
-        while (<$tmp_fh>) { 
-            next if (m|^\s*$|);
-            push(@L, $_);
+        TMP_LINES:
+        while ($line = <$tmp_fh>) { 
+            next TMP_LINES if ($line =~ m|^\s*$|);
+            push(@L, $line);
         }
         close($tmp_fh);
         @L = sort(@L);
             }
         }
     }
-    if (m|^%%INCL%%|) {
+    if (defined($line) && ($line =~ m|^%%INCL%%|)) {
         open(my $tmp_fh, '<', $incl)
             or die "Cannot open incl file - '$incl' - $!";
         @L = ();
-        while (<$tmp_fh>) { 
-            next if (m|^\s*$|);
-            push(@L, $_);
+        TMP2_LINES:
+        while ($line = <$tmp_fh>) { 
+            next TMP2_LINES if ($line =~ m|^\s*$|);
+            push(@L, $line);
         }
         close($tmp_fh);
         @L = sort(@L);
             }
         }
     }
-    else {
-        print {$out_fh} $_;
+    elsif (defined($line)) {
+        print {$out_fh} $line;
     }
 }
 close($in_fh);