[svn:parrot] r46257 - trunk/tools/docs

chromatic at svn.parrot.org chromatic at svn.parrot.org
Mon May 3 22:58:24 UTC 2010


Author: chromatic
Date: Mon May  3 22:58:24 2010
New Revision: 46257
URL: https://trac.parrot.org/parrot/changeset/46257

Log:
[tools] Made tools/docs/filename_and_chapter.pl compile again, then removed the
unnecessary prototype and cleaned up some clunky code.

Modified:
   trunk/tools/docs/filename_and_chapter.pl

Modified: trunk/tools/docs/filename_and_chapter.pl
==============================================================================
--- trunk/tools/docs/filename_and_chapter.pl	Mon May  3 22:34:07 2010	(r46256)
+++ trunk/tools/docs/filename_and_chapter.pl	Mon May  3 22:58:24 2010	(r46257)
@@ -10,10 +10,6 @@
 use strict;
 use warnings;
 
-# prototype
-sub write_mod($);
-
-
 use Getopt::Long ();
 use Pod::PseudoPod::LaTeX;
 
@@ -32,18 +28,18 @@
 );
 
 if ($give_out)  {
-    for ( my $i=0; $i<$lang; $i++ )
-        { print $$item_list_ref[$i][0], "\n" }
+    for my $i (0 .. $lang)
+        { print $item_list_ref->[$i][0], "\n" }
     exit;
 };
 
 
-for ( my $i=0; $i<$lang; $i++ ) {
+for my $i (0 .. $lang) {
     write_mod( $i );
 }
 
 
-open my $TEX_FH, '>', 'build/parrot-book.tex');
+open my $TEX_FH, '>', 'build/parrot-book.tex';
 
 print $TEX_FH <<'HEADER';
 \documentclass[11pt,a4paper,oneside]{report}
@@ -67,25 +63,22 @@
 close( $TEX_FH );
 
 
-sub write_mod( $ ) {
+sub write_mod {
     my $icnt;
 
-    open( my $IN_FH, '<', "$$item_list_ref[$_[0]][0]" ) ||
-        die( "$0: can't open $$item_list_ref[$_[0]][0] for reading ($!)\n" );
-    open( my $OUT_FH, '>', "${MOD_BUILD_PATH}$$item_list_ref[$_[0]][0]" );
+    open( my $IN_FH, '<', $item_list_ref->[$_[0]][0] ) or
+        die( "$0: can't open $item_list_ref->[$_[0]][0] for reading ($!)\n" );
+    open( my $OUT_FH, '>', "${MOD_BUILD_PATH}$item_list_ref->[$_[0]][0]" );
 
-    # do the same as: sed -e '4,6c\=head0 $$item_list_ref[$i][1]'
+    # do the same as: sed -e '4,6c\=head0 $item_list_ref->[$i][1]'
     while( <$IN_FH> ) {
         if ( $icnt = (4..6) ) {
             if ( $icnt =~ /E0$/ ) {
-                print( $OUT_FH "=head0 $$item_list_ref[$_[0]][1]\n");
+                print( $OUT_FH "=head0 $item_list_ref->[$_[0]][1]\n");
             }
         }
         else { print( $OUT_FH ); }
     }
-
-    close( $IN_FH );
-    close( $OUT_FH );
 }
 
 


More information about the parrot-commits mailing list