Bryan Harris wrote:

$newtxt =~ s/([^\n])$/$1\n/;

This is clearer:


$newtext = "Hello\n\n\n";
$newtext =~ s/\n+/\n/;
print $newtext;

-Sx-

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




Reply via email to