D
Diamond, Mark
Hello (I posted this in alt.comp.lang.perl but I think it should be here)
....
I am processing multiple text files. There is a lot of pre-processing before
the file-reading commences, then each file gets read (but I don't want to
print any blank line) and then there is a lot of post-processing of each
file. In AWK I had a BEGIN block, no print lines in the middle, and a very
long END block. In Perl, I have
pre-code
while (<>) {
lots of processing of file lines with only one wanted "print"
}
post-processing
but I get a blank line output on any line that I don't actually do an
explicit print for. I thought "perl -n" would give me what I need but it
doesn't (of course) because of the wrapped "while(<>) { }" .
Please ... what should I be doing?
Mark
....
I am processing multiple text files. There is a lot of pre-processing before
the file-reading commences, then each file gets read (but I don't want to
print any blank line) and then there is a lot of post-processing of each
file. In AWK I had a BEGIN block, no print lines in the middle, and a very
long END block. In Perl, I have
pre-code
while (<>) {
lots of processing of file lines with only one wanted "print"
}
post-processing
but I get a blank line output on any line that I don't actually do an
explicit print for. I thought "perl -n" would give me what I need but it
doesn't (of course) because of the wrapped "while(<>) { }" .
Please ... what should I be doing?
Mark