Git fork

Documentation: modernize cat-texi.perl

Good style for Perl includes using the strict and warnings pragmas, and
preferring lexical file handles over bareword file handles. Using
lexical file handles necessitates being explicit when $_ is printed, so
that Perl does not get confused and instead print the glob ref.

The benefit of this modernization is that a formerly obscured bug is now
visible, which will be fixed in a followup patch.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

authored by

brian m. carlson and committed by
Junio C Hamano
b56867c9 f7bf8fea

+9 -6
+9 -6
Documentation/cat-texi.perl
··· 1 1 #!/usr/bin/perl -w 2 2 3 + use strict; 4 + use warnings; 5 + 3 6 my @menu = (); 4 7 my $output = $ARGV[0]; 5 8 6 - open TMP, '>', "$output.tmp"; 9 + open my $tmp, '>', "$output.tmp"; 7 10 8 11 while (<STDIN>) { 9 12 next if (/^\\input texinfo/../\@node Top/); ··· 13 16 } 14 17 s/\(\@pxref\{\[(URLS|REMOTES)\]}\)//; 15 18 s/\@anchor\{[^{}]*\}//g; 16 - print TMP; 19 + print $tmp $_; 17 20 } 18 - close TMP; 21 + close $tmp; 19 22 20 23 printf '\input texinfo 21 24 @setfilename gitman.info ··· 34 37 print "* ${_}::\n"; 35 38 } 36 39 print "\@end menu\n"; 37 - open TMP, '<', "$output.tmp"; 38 - while (<TMP>) { 40 + open $tmp, '<', "$output.tmp"; 41 + while (<$tmp>) { 39 42 print; 40 43 } 41 - close TMP; 44 + close $tmp; 42 45 print "\@bye\n"; 43 46 unlink "$output.tmp";