Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: RFC: Shortening line length in HTML Emails

by Anonymous Monk
on Nov 07, 2016 at 22:29 UTC ( [id://1175485]=note: print w/replies, xml ) Need Help??


in reply to RFC: Shortening line length in HTML Emails

Here's what I use:

use Text::Format; my $text = 'some text string of words, possibly having more than 990 c +haracters ...'; my $text_obj = Text::Format->new( { columns => 990, firstIndent => 0, bodyIndent => 0, } ); $text = $text_obj->format($text);

I've read that Sendmail's default is 990 rather than 1000; I think I ran into the 990 limitation when sending email through my local Postfix installation (which replaces Sendmail), and hence picked 990 as the "columns" parameter to send to Text::Format.

Text::Format splits the string into words, meaning it splits on white space (\s+). A seven-letter word that starts at column 986 after a blank at column 985 wouldn't be printed as 5 characters ending at column 990 with the remaining two characters starting on column 1 of the next line; it would move the word to be the start of the next line. The previous line would end with the word whose last character is in column 984 (assuming for purposes of this example that a single blank space existed between that word and the word that's moved down to start the next line).

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1175485]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (5)
As of 2024-04-20 00:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found