in reply to Re^2: html format email
in thread html format email
What you want to do is separate the data and code, having the code process the data. Something like:
use strict; use warnings; my $data = qq{ <h1 border=\"1\" align=\"center\">Welcome to ATCA Booking and man +agment system<br>Chassis information and detail</h1> <body> <TABLE cellSpacing=\"0\" cellPadding=\"0\" border=\"1\" align=\"c +enter\"> <TR align=\"center\"><TD>No</TD><TD>version</TD><TD>Chassis</TD><T +D>Assigned</TD><TD>CMMIP1</TD><TD>CMMIP2</TD><TD>CMM1<br>SerialPortCo +nnection</TD><TD>CMM2<br>SerialPortConnection</TD><TD>Ibootbar_Altuse +n</TD></TR> </table> }; # Open db for reading -- but die if there's an error open(INFO, "data2.txt") or die "Failed to open 'data2.txt' ($!)\n"; my @array = <INFO>; close (INFO); my @ascend=sort(@array); my $i = 1; foreach my $line (@ascend){ my ($version, $okok) = split(/\|/,$line); $data .= qq{ <TR><TD align=\"center\"> $i </TD><TD> $version </TD> }; ++$i; } print "DATA:\n $data\n";
Update: put back $i, which I now see was in each first <td>
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: html format email
by GordonLim (Acolyte) on Apr 09, 2013 at 02:26 UTC |