S
SL_McManus
Hi All;
I'm fairly new to PERL. The problem I am running into is that I
need to chop the last line of the output file and place the count
record on that line. As it stands, there is a blank space and this
creates a problem. What can I do to test for an EOF condition, then
chop the last line? Thanks.
open(OUTFILE,'>' .$outfile) || die "cannot create $outfile: $!\n";
%priminput = ();
foreach $line (@firstlist) {
$priminput{$line} = 1;
print OUTFILE "$line \n";
# if (eof) {
# chop $line;
# }
}
{
for ($lineread=0; $lineread<=@firstlist;$lineread++) {
}
$x = $lineread / $linecount;
$x = sprintf ( "%.0f", $x );
print OUTFILE "CR $x\n";
}
close(OUTFILE);
print "finished!\n";
1;
__END__
I'm fairly new to PERL. The problem I am running into is that I
need to chop the last line of the output file and place the count
record on that line. As it stands, there is a blank space and this
creates a problem. What can I do to test for an EOF condition, then
chop the last line? Thanks.
open(OUTFILE,'>' .$outfile) || die "cannot create $outfile: $!\n";
%priminput = ();
foreach $line (@firstlist) {
$priminput{$line} = 1;
print OUTFILE "$line \n";
# if (eof) {
# chop $line;
# }
}
{
for ($lineread=0; $lineread<=@firstlist;$lineread++) {
}
$x = $lineread / $linecount;
$x = sprintf ( "%.0f", $x );
print OUTFILE "CR $x\n";
}
close(OUTFILE);
print "finished!\n";
1;
__END__