I don't have any pre-dev'd solution for you.. however may I reccomend the following (just off the top of my head)

use strict; use warnings; #Just listing a few bad chars (I think hehe) for example my %escap_chars = ( '>' => '&gt;', '<' => '&lt;}; #Text for email would either be in array or scalar I'll presume my $email_text = 'Hi this is a math email 2 + 2 = 4. and 4 > 5'; #if scalar foreach my $key (keys(%escape_chars)) { $email_text =~ s/$key/$escape_chars{$key}/g; } # if each line of email is in an array foreach my $key (keys(%escape_chars)) { s/$key/$escape_chars{$key}/g for(@email_text); }
Just as a method for dropping characters that need escaping and changing to their HTML counterpart. I believe (don't know for sure obviously) that this is something like what you would need to do. I believe there is a module that has a http link regex that you can use. Also just as a feature thought. you could test the links you find to make sure they are valid (read: not broken)links..


Grygonos

In reply to Re: Text to HTML convert. by Grygonos
in thread Text to HTML convert. by SiGiN

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.