如何在perl html表中显示值?

时间:2013-08-12 06:56:32

标签: perl html-table html-email

我在perl文件中有以下HTML代码,我正在发送邮件。邮件部分和html部分很好,但是当我尝试在DATA中添加perl代码时$BStatus$AStatus显示它的原样!上述两个变量的值已经存在,我确认了它。

如何显示其值?

$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();

1 个答案:

答案 0 :(得分:1)

Perl不会在单引号字符串中插入变量。

使用:

  • 双引号字符串
  • 双引号字符串的替代语法之一,例如qq[...]
  • 正确的模板系统