I know how to loop through an array and check for blank lines, but I cannot figure this one out.
Typically, this is what I use to check for blank lines:
or:
My question is:
How can I remove blank lines ONLY if a blank line is before it AND after it?
Thanks in advance for any thoughts/suggestions!
X
Typically, this is what I use to check for blank lines:
Code:
foreach my $ln(@html) {
unless($ln eq "\n" ){
print $ln;
}
}
or:
Code:
foreach my $ln(@html) {
unless($ln =~ /^\s$/ ){
print $ln;
}
}
My question is:
How can I remove blank lines ONLY if a blank line is before it AND after it?
Thanks in advance for any thoughts/suggestions!
X