Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??

hi

This is sample HTML file which is called as sample.html
<html> <body> <table width="531" border="0" align="center" cellpadding="0" cellspacing="0"> <tbody> <tr> <td width="512" valign="top"> <table width="805" cellspacing="0" cellpadding="0" border="0"> <tbody> <tr> </tr> <tr> <td width="4" valign="top" rowspan="3">&nbsp;</td> <td width="948"> <div align="right"> <blockquote> <h2 align="right"><b>Online e-Statement </b></h2> </blockquote> </div></td> <td width="1" valign="top" rowspan="3"></td></tr> <tr> <td> <table width="800" cellspacing="0" cellpadding="20" border="0"> <tbody> <tr> <td width="564" valign="top"> <p align="left"><b>Dear BH_PERL,<br> <br> </b>Thank you for subscribing to Online E-Statement. As our valued cus +tomer, your satisfaction is our utmost priority. To view or open your statement, please key-in the predefined password as xxxx. <br> <br> <br> Thank you </br> <br></p><p align="left">Sincerely, <br> </p> </td> <td width="304" valign="top"> <p align="left"><span><strong>Bill Date</strong></span><br>10 Septembe +r 2012</p> <p align="left"><strong>PAYMENT DUE DATE</strong><br>30 September 2012</p> </td> </tr> </tbody> </table></td></tr> <tr> </tr> <tr> <td valign="top" colspan="3"></td></tr></tbody></table></td> </tr> </tbody> </table> </body> </html>

This is sample of my readHTML.pl script. It is not completed yet due to this problem. But i attached here for your reference.
#!/usr/bin/perl use Getopt::Long; my ($inputfile, $logfile); GetOptions ( "h|help"=> \$help, "f=s" => \$inputfile, "l=s" => \$logfile ) or usage(); sub usage { print ("Invalid Command!! \n"); print ("USAGE: $0 -l <log_file> -f <csv_input_file> \n"); exit; } open (CONFIG, "$inputfile"); while ($line = <CONFIG>) { chomp($line); $line =~ s/"//g; next if $line =~ /^FromName/; @data = split(/\,/, $line); $FromName = $data[0]; $FromMail = $data[1]; $ToName = $data[2]; $ToMail = $data[3]; $CCName = $data[4]; $CCMail = $data[5]; $BCCName = $data[6]; $BCCMail = $data[7]; $ReplyName = $data[8]; $ReplyMail = $data[9]; $Subject = $data[10]; $ReplyMail = $data[9]; $Subject = $data[10]; $TextFile = $data[11]; $HtmlFile = $data[12]; $ReturnName = $data[13]; $ReturnMail = $data[14]; $ReturnReceipt = $data[15]; $ReadReceipt = $data[16]; $Attachment = $data[17]; $blank1 = $data[18]; $blank2 = $data[19]; $AddPdfFile = $data[20]; open (LOG,">> $logfile"); print (LOG localtime(time) . ",$email_id,$attach,$cust_name,$s +date,$ddate\n"); $msg = MIME::Lite->new( To =>$ToEmail, From =>$FromName, Subject =>$Subject, Type =>'multipart/related' ); $msg->attach( ############################## # Called HTML script here... # ############################## ); $msg->attach( Type => 'image/gif', Id => "$Attachment", Path => "$Attachment" ); $msg->send(); close(LOG); } close(CONFIG);

My question is how could i read and open the HTML script file (sample.html) from readHTML.pl script.

Thank you,

In reply to How to process html script with perl by bh_perl

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!
  • 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, 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, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • Outside of code tags, you may need to use entities for some characters:
            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.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others studying the Monastery: (12)
    As of 2014-08-22 16:20 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      The best computer themed movie is:











      Results (160 votes), past polls