) {
print CTMP $_;
}
print CTMP "-----\n";
close(TMP);
close(CTMP);
$comment = 0;
open(TMP, ">$tmp") || die "Error opening tmp $!";
print TMP "";
close(TMP);
}
if( $entry == 1 && $L =~ m/<\/div>/) { # Entry body end
$entry = 2;
close(BTMP);
}
if( $comment == 1 && $L =~ m//) { # Comment body end
$comment = 2;
close(TMP);
}
# If we're in the entry body, print the line to the scratch file:
if( $entry == 1 && $L =~ /\S/ ) {
$L =~ s/\t//g;
print BTMP $L;
}
# If we're in a comment body, print to comment scratch:
if( $comment == 1 && $L =~ /\S/ ) {
$L =~ s/<\/?p>//g;
$L =~ s/\t//g;
print TMP $L;
}
if( $L =~ m/entrytext/) { # Entry body start
print OUT "STATUS: Publish\n";
open(BTMP, ">>$btmp") || die "Error opening btmp $!";
$entry = 1;
}
if( $L =~ m/
/) { # Comment start
open(TMP, ">>$tmp") || die "Error opening scratch $!";
$comment = 1;
if( $ctog == 0 ) { $ctog = 1; }
}
}
print OUT "--------\n";
close(DATA);
}
close(OUT);