[svn:parrot] r46280 - trunk/tools/docs
gerd at svn.parrot.org
gerd at svn.parrot.org
Tue May 4 13:45:28 UTC 2010
Author: gerd
Date: Tue May 4 13:45:28 2010
New Revision: 46280
URL: https://trac.parrot.org/parrot/changeset/46280
Log:
fixed to work again; if the filehandle "OUT_FH" will be replaced with a variable then the script do not work
Modified:
trunk/tools/docs/filename_and_chapter.pl
Modified: trunk/tools/docs/filename_and_chapter.pl
==============================================================================
--- trunk/tools/docs/filename_and_chapter.pl Tue May 4 12:08:23 2010 (r46279)
+++ trunk/tools/docs/filename_and_chapter.pl Tue May 4 13:45:28 2010 (r46280)
@@ -18,7 +18,7 @@
['submissions.pod', 'Submitting bug reports and patches'],
];
-my $lang = @$item_list_ref;
+my $lang = @$item_list_ref - 1;
my $MOD_BUILD_PATH='build/modified_pod/';
my ( $result, $give_out );
@@ -28,13 +28,13 @@
);
if ($give_out) {
- for my $i (0 .. $lang)
+ for my $i ( 0.. $lang )
{ print $item_list_ref->[$i][0], "\n" }
exit;
};
-for my $i (0 .. $lang) {
+for my $i ( 0..$lang ) {
write_mod( $i );
}
@@ -50,10 +50,10 @@
\tableofcontents
HEADER
-for ( my $i=0; $i<$lang; $i++ ) {
+for my $i ( 0..$lang ) {
my $parser = Pod::PseudoPod::LaTeX->new();
$parser->output_fh( $TEX_FH );
- $parser->parse_file( "${MOD_BUILD_PATH}$$item_list_ref[$i][0]" );
+ $parser->parse_file( "${MOD_BUILD_PATH}$item_list_ref->[$i][0]" );
}
print $TEX_FH <<'FOOTER';
@@ -68,17 +68,20 @@
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]" );
+ open( OUT_FH, ">${MOD_BUILD_PATH}$item_list_ref->[$_[0]][0]" );
# 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 ); }
+ else { print( OUT_FH ); }
}
+
+ close( $IN_FH );
+ close( OUT_FH );
}
More information about the parrot-commits
mailing list