- 论坛徽章:
- 0
|
这是代码:::
use strict;
my $project;
my $Configuration;
my $Errors;
my $Warnings;
my $logfile = "Log.htm";
if(-e $logfile)
{
open LOGFILE, "<$logfile" or die "打开文件失败:$!";
while (<LOGFILE>)
{
my $str = chomp($_);
print $str;
if($str =~/Project: [\w],Configuration: [\w]/)
{
my $pos=index($str,",");
my $str1 =substr($str,0,$pos);
my $pos1=index($str1,":");
$project = substr($str1,$pos1 +1);
my $str2 =substr($str,$pos+1);
my $pos2=index($str2,":");
$Configuration = substr($str2,$pos2 +1);
}
}
print "Project =".$project;
print "\n";
print "Configuration=".$Configuration;
print "\n";
}
这是html部分文件:
<html>
<head>
<META HTTP-EQUIV="Content-Type" content="text/html; charset=utf-16">
</head>
<body>
<pre>
<table width=100% bgcolor=#CFCFE5><tr> <td> <font face=arial size=+3>
Build Log
</font></table><table width=* cellspacing=0 cellpadding=0><tr><td width=0
现在的问题就是像我上面所说的比如第一行<html>,读出来是? h t m l>, |
|