ultranerds has asked for the wisdom of the Perl Monks concerning the following question:
$html =~ s/\r+/\n/sig; $html =~ s/\t+/ /sig; $html =~ s/[\n]{2,5}/\n/sig;
#!/usr/bin/perl print "Content-Type: text/html \n\n"; my $html = q| some stuff sdfsdfsdf dfgd fg sdfsdfsf |; # $html =~ s/\r+/\n/sig; # $html =~ s/\t+/ /sig; $html =~ s/\s+/ /sig; # $html =~ s/[\n]{2,5}/\n/sig; print $html;
TIAperl ./cgi-bin/test.cgi Content-Type: text/html some stuff sdfsdfsdf dfgd fg sdfsdfsf
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Replacing \n even when it shouldn't be :/
by cdarke (Prior) on May 18, 2010 at 08:04 UTC | |
by ultranerds (Hermit) on May 18, 2010 at 08:15 UTC | |
|
Re: Replacing \n even when it shouldn't be :/ ([^\S\n])
by tye (Sage) on May 18, 2010 at 18:16 UTC | |
|
Re: Replacing \n even when it shouldn't be :/
by poolpi (Hermit) on May 18, 2010 at 12:34 UTC | |
|
Re: Replacing \n even when it shouldn't be :/
by JavaFan (Canon) on May 18, 2010 at 15:03 UTC |