Peter Holsberg wrote:
I think I've isolated the section that is not doing what I want.
open (FHIN, "$recapfile") or die $!;
That would be better as:
open my $FHIN, '<', $recapfile or die "Cannot open '$recapfile' because:
$!";
my $indexb; ## for the recapfile array
my $ofile;
You never use this variable, it should be:
my @ofile;
# Create new array containing all the lines of recapfile up to
# the string RESULTS OF BOARD 1
XYZZY:
while (<FHIN>)
{
last XYZZY if / RESULTS OF BOARD 1/;
chomp;
$ofile[$indexb++] .= $_;
That would be better as:
push @ofile, $_;
}
close FHIN;
To see what was put into ofile, a line at a time, I used
foreach (@ofile) {
print "$_\n";
}
Is that correct?
That is correct.
John
--
Any intelligent fool can make things bigger and
more complex... It takes a touch of genius -
and a lot of courage to move in the opposite
direction. -- Albert Einstein
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/