Documentation: modernize cat-texi.perl
[gitweb.git] / Documentation / cat-texi.perl
index b1fe52e8b9af7aef28501094caac50924de3af1b..1bc84d3c7cc5dbf5da5c0c8cf4f0e9be5866770e 100755 (executable)
@@ -1,9 +1,12 @@
 #!/usr/bin/perl -w
 
+use strict;
+use warnings;
+
 my @menu = ();
 my $output = $ARGV[0];
 
-open TMP, '>', "$output.tmp";
+open my $tmp, '>', "$output.tmp";
 
 while (<STDIN>) {
        next if (/^\\input texinfo/../\@node Top/);
@@ -13,9 +16,9 @@
        }
        s/\(\@pxref\{\[(URLS|REMOTES)\]}\)//;
        s/\@anchor\{[^{}]*\}//g;
-       print TMP;
+       print $tmp $_;
 }
-close TMP;
+close $tmp;
 
 printf '\input texinfo
 @setfilename gitman.info
        print "* ${_}::\n";
 }
 print "\@end menu\n";
-open TMP, '<', "$output.tmp";
-while (<TMP>) {
+open $tmp, '<', "$output.tmp";
+while (<$tmp>) {
        print;
 }
-close TMP;
+close $tmp;
 print "\@bye\n";
 unlink "$output.tmp";