in reply to text formatting

Not for me.
use Text::Format; $body = "The Email Issue (matter getting shattering/ numbers coming in + between etc..) was addressed to jiju and he is looking into this wit +h highest priority. This will be fixed ASAP."; $body = Text::Format->new({columns => 70,firstIndent => 0})->form +at($body); print $body;
>perl a.pl The Email Issue (matter getting shattering/ numbers coming in between etc..) was addressed to jiju and he is looking into this with highest priority. This will be fixed ASAP.

Are you sure it's a space before the opening paren?

Replies are listed 'Best First'.
Re^2: text formatting
by karun.jiju (Initiate) on Feb 16, 2010 at 09:34 UTC
    The issue is that while formatting with this code after a few words not after 70 columns but before that the text will split and the next words will come in new line but there will no extra character in between the words to make a new line.

      I doubt that anyone understands what you are saying...

      Here is some advice:

      • Post full code that can be copied/pasted and run. This includes declaring $body
      • Paste the output you get
      • Paste the output you expected

      I did not understand that either. If you want my help and you can't find a means of expressing yourself in English or French, just provide
      • A small piece of runnable code.
      • The output it produces for you.
      • The output you desire from it.
      I should be able to figure out the rest

        Hi,

        I was in the process of implementing a custom Email interface using Perl. For this I used, POP::MailClient (for downloading mails from Qmail server), MIME::Parser(for reading the body content).
        Initially we had issues when displaying the mail content in the web interface, where special symbols like =A0, =, some HTML tags would be shown in the mail content. This was fixed after introducing MIME::Base64 and MIME::QuotedPrint.
        Now, we are trying to figure a way to format the mail message that needs to be displayed in the web interface. As you may be aware, we can use either text/plain or text/html part of actual mail file for displaying the mail message. Here we can use only text/html as it supports formatting like "Bold" "Italics" Colors etc. We were able to strip that part but, at some times, the message doesn't get wrapped after a fixed number of characters, and hence the readers will have to scroll from left to right to read the message. So we tried to word wrap the contents using Text::Format module. But here, it gets word wrapped in random places. We gave the option to word wrap after 70 characters but it is not working as expected. Maybe we interpreted the working of the module in a wrong way. Please go through the script which we are using to display the mail message and also a typical mail file that we are trying to display the message in the web interface.We are interested in displaying the contents that comes under Content Type: text/html in the mail file.

        If I had an option to include the screenshot, it would've been better to show the current formatting. But I don't know how I can show the current text formatting without it. But I will give a try. Please go through.


        ##################CURRENT MAIL INTERFACE OUTPUT########################
        Hi Lara,
        The Email Issue (matter
        getting shattering/ numbers coming in between etc..) was addressed to
        Joseph and he is looking into this with highest priority. This
        will be fixed ASAP.
        Thanks,






        Scott Valentine
        QC - Manager (Sales)
        Xxxxxxxx Software
        Solutions, Inc.
        XXXXXXXXXXX Medical Transcription Services
        XXXX
        Martins Rd.
        Xxxxxxxx, AZ XXXXX
        Phone:
        XXX-XXX-XXXX
        www.xxxxxxxxxxx.com

        ###################################EXPECTED MAIL INTERFACE OUTPUT########################################

        Hi Lara,
        The Email Issue (matter getting shattering/ numbers coming in between
        etc..) was addressed to Joseph and he is looking into this with highest
        priority. This will be fixed ASAP.
        Thanks,

        Scott Valentine
        DS - Manager (Mktng)
        Xxxxxxxx Software Solutions, Inc.
        XXXXXXXXXXX Medical Transcription Services
        XXXX Martins Rd.
        Xxxxxxxx, AZ XXXXX
        Phone: XXX-XXX-XXXX
        www.xxxxxxxxxxx.com
        ##################################QMAIL FILE - RAW###############################

        Subject: Email Issue
        Date: Mon, 8 Feb 2010 00:45:32 -0500
        X-Mailer: Perl script "cms.pl" using Mail::Sender 0.8.16 by Jenda Krynicky, Czechlands
        running on xxx.yyyyyyyyyyy.com (127.0.0.1) under account "apache"
        Message-ID: <20100208_054532_075707.ds_mgr1@xxxxx.yyyyyyyyyyy.com>
        MIME-Version: 1.0
        Content-type: text/html

        Hi Lara,
            The Email Issue (matter getting shattering/ numbers coming in between etc..) was addressed to Joseph and he is looking into this with highest priority. This will be fixed ASAP.

        Thanks,







        Scott Valentine
        DS - Manager (Mktng)
        Xxxxxxxx Software Solutions, Inc.
        XXXXXXXXXXX Medical Transcription Services
        XXXX Martins Rd.
        Xxxxxxxx, AZ XXXXX
        Phone: XXX-XXX-XXXX
        www.xxxxxxxxxxx.com
        ###################################################################################

        I would apprciate if you can suggest some ideas or any clues. Thank you.

        #!/usr/bin/perl use CGI; use CGI::Carp qw(fatalsToBrowser); use Text::Format; my $q = new CGI; print $q->header(); my $body = "<pre></pre>Hi Lara,<br>&nbsp;&nbsp;&nbsp; The Email Issue +(matter getting shattering/ numbers coming in between etc..) was addr +essed to Joseph and he is looking into this with highest priority. Th +is will be fixed ASAP.<br><br>Thanks,<br> <br/><br/><br/><br/><b +r/><br/> <br/> Scott Valentine<br>DS - Manager (Mktng)<br>Xxxxxxxx Software Solutions +, Inc.<br>XXXXXXXXXXX Medical Transcription Services<br>XXXX Martins +Rd.<br>Xxxxxxxx, AZ XXXXX<br>Phone: XXX-XXX-XXXX<br>www.xxxxxxxxxxx.c +om<br/>"; $body = Text::Format->new({columns => 70,firstIndent => 0})->form +at($body); print $body;