http://www.perlmonks.org?node_id=1001443

bh_perl has asked for the wisdom of the Perl Monks concerning the following question:


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,