1
我最近开始Perl,并混合了很多东西来获得我想要的。Getstore缓冲区,不使用临时文件
我的脚本获取网页的内容,将其写入文件。
然后我打开一个文件处理程序,将文件report.html插入(对不起,我不是英文,我不知道怎么说更好)并解析它。 我写的每一行我遇到一个新的文件,除了包含特定颜色的行。
它的工作原理,但我想尝试另一种方式,不需要我创建一个“report.html”临时文件。此外,我想直接在文件中打印我的结果,我不想使用系统重定向'>'。这意味着我的脚本必须由另一个.sh脚本调用,而我不希望这样。
use strict;
use warnings;
use LWP::Simple;
my $report = "report.html";
getstore('http://test/report.php', 'report.html') or d\
ie 'Unable to get page\n';
open my $fh2, "<$report" or die("could not open report file : $!\n");
while (<$fh2>)
{
print if (!(/<td style="background-color:#71B53A;"/ .. //));
}
close($fh2);
感谢您的帮助