How to display values in perl html table?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ramki067
    New Member
    • Aug 2013
    • 2

    How to display values in perl html table?

    Hi,

    I've the below HTML code inside a perl file where i'm sending a mail. The mail part and html part is fine. but when i try to add perl code inside DATA as $BStatus and $AStatus its showing as it is! Values for the above two variables is already present and i confirmed it.
    How do i display its values. Kindly help.

    Code:
     $tme=localtime(); $subject='Android Results';  use MIME::Lite; my $msg = MIME::Lite->new ( Subject => $subject, From    => 'xyz@gmail.com', To      => 'xyz@gmail.com', Type    => 'text/html', Data    => '<H1>Summary</H1><br> <table border="1"> <tr bgcolor="#87CEFA"> <th>Platforms</th> <th>BStatus</th> <th>AStatus</th> <th>Results</th> </tr>  <tr> <th bgcolor="#87CEFA">123</th> <td>$kstatus</td> <td>$astatus</td> <td> <a href="http://xx.xxx.xx.xx/Android/123.html">123-Results</a> </tr>  <tr> <th bgcolor="#87CEFA">atgs</th> <td>row 2, cell 2</td> <td>row 2, cell 3</td> </tr>  <tr> <th bgcolor="#87CEFA">8765</th> <td>row 2, cell 2</td> <td>row 2, cell 3</td> </tr>  <tr></table>
    '
    );
    $msg->send();
    Thanks.
  • rski
    Recognized Expert Contributor
    • Dec 2006
    • 700

    #2
    you have to surround DATA part with " " not ' ', like that
    Code:
    my $subject='Android Results';
    
    use MIME::Lite;
    
    my $msg = MIME::Lite->new (     Subject => $subject
                                    , From    => 'xxxx@gmail.com'
                                    , To      => 'yyyy@gmail.com'
                                    , Type    => 'text/html'
                                    , Data    => "<H1>Summary</H1><br> <table border='1'> <tr bgcolor='#87CEFA'> <th>Platforms</th> <th>$BStatus</th> <th>AStatus</th> <th>Results</th> </tr>  <tr> <th bgcolor='#87CEFA'>123</th> <td>$kstatus</td> <td>$astatus</td> <td> <a href='http://xx.xxx.xx.xx/Android/123.html'>123-Results</a> </tr>  <tr> <th bgcolor='#87CEFA'>atgs</th> <td>row 2, cell 2</td> <td>row 2, cell 3</td> </tr>  <tr> <th bgcolor='#87CEFA'>8765</th> <td>row 2, cell 2</td> <td>row 2, cell 3</td> </tr>  <tr></table>
    "
    );
    
    $msg->send();

    Comment

    Working...