Grant wrote:
Hello,

I'm having a lot of trouble figuring out how to remove blank lines
from my HTML.  The lines are generated by my shopping cart.  I use
(and highly recommend) interchange:

http://www.icdevgroup.org

I basically want to wrap all of my code in [filter
no_blank_lines][/filter].  no_blank_lines is defined this way:

CodeDef no_blank_lines Routine <<EOR
sub {
my $val = shift;
#$val =~ s/\s+//g;
#$val =~ s/\s*\n+\s*/\n/g;
#$val =~ s/[^\S\n]*\n\s*\n/\n/g;
$val =~ s/\n\n+/\n/g;
return $val;
}
EOR

Those are all regexp's I've tried.  They all seem to do nothing except
the first one removes all whitespace including the spaces in between
characters in my code which obviously breaks everything.  Can anyone
suggest a solution?

 $val =~ s/^\s*\n//mg;

Rob

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to