我在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();
答案 0 :(得分:1)
Perl不会在单引号字符串中插入变量。
使用:
qq[...]