- 论坛徽章:
- 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";
- }
- if ($line =~ m{kavset - (\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>
- <h3>kavset - 0 error(s), 1 warning(s)</h3>
- </body>
- -----------------------
- >perl -w test.pl
- Project = kavset
- Configuration = Release|Win32
- Error = 0
- Warnings = 1
- >Exit code: 0
复制代码 |
|