- 論壇徽章:
- 0
|
- use strict;
- my $project;
- my $configuration;
- my $error;
- my $warning;
- my $logfile = "Log.html";
- open LOGFILE, "<$logfile" or die "$!\n";
- while (my $line = <LOGFILE>) {
- chomp $line; # and print $line;
-
- if ($line =~ m{Project: (\w+), Configuration: (\w+\|\w+)}) {
- $project = $1 if defined $1;
- $configuration = $2 if defined $2;
- print "Project = $project\n";
- print "Configuration = $configuration\n";
- next;
- }
- if ($project and $line =~ m{$project - (\d+) error\(s\), (\d+) warning\(s\)}) {
- $error = $1 if defined $1;
- $warning = $2 if defined $2;
- print "Error = $error\n";
- print "Warnings = $warning\n";
- }
- }
- ---------------------------
- <html>
- <head>
- <META HTTP-EQUIV="Content-Type" content="text/html; charset=utf-16">
- </head>
- <body>
- <h3>Rebuild started: Project: kavset, Configuration: Release|Win32</h3>
- </font></table><table width=* cellspacing=0 cellpadding=0><tr><td width=0 bgcolor=#EDEDF5> </td><td width=0 bgcolor=#FFFFFF> </td><td width=*><pre>Build log was saved at "file://e:\Build\Build_Src\KIS\kis\kav32\kav32.set\Release\BuildLog.htm"
- kavset - 10 error(s), 11 warning(s)
- </pre></table><table width=100% height=20 bgcolor=#CFCFE5><tr><td><font face=arial size=+2>
- </font></table>
- </body>
- </html>
- ----------------------------------------
- >perl -w test.pl
- Project = kavset
- Configuration = Release|Win32
- Error = 10
- Warnings = 11
- >Exit code: 0
復(fù)制代碼
你看,沒問題啊
[ 本帖最后由 cobrawgl 于 2007-9-25 16:41 編輯 ] |
|