in reply to Unexpected results using Text::Correct and MIME::Lite

At first I thought this might be a bug in Text::Correct. Then I thought it might be the intended behavior, but you needed to split the text into lines before passing it to wrap.

Then I actually downloaded Text::Correct, and got the proper behavior in my testing. So, now I have a third theory:

The text you are wrapping probably has "\r\n" line endings (since it comes from CGI data), which Text::Correct doesn't account for. Try deleting the \r characters from the text before you wrap it:

$tp =~ tr/\r//d; $th =~ tr/\r//d;
I hope that helps!

Replies are listed 'Best First'.
Re: Re: Unexpected results using Text::Correct and MIME::Lite
by Daddio (Chaplain) on Jul 02, 2001 at 01:24 UTC

    Thanks, chipmunk. This did the trick. It's kind of funny, but at one point I actually saw the %13%10 (or whatever the encoding is) on the end of the lines, and thought nothing of it. I added your tr/\r//d to the code, and it works like a champ! Thanks again!

    D a d d i o