- 论坛徽章:
- 0
|
- use strict;
- my $project;
- my $configuration;
- 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+)\]}) {
- $project = $1 if defined $1;
- $configuration = $2 if defined $2;
- print "Project = $project\n";
- print "Configuration = $configuration\n";
- }
- }
- --------------
- <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>
- Project: [sky], Configuration: [earth]
- </td>
- </tr>
- </table>
- </body>
- -------------------------------
- >perl -w test.pl
- Project = sky
- Configuration = earth
- >Exit code: 0
复制代码
是不是这样 
[ 本帖最后由 cobrawgl 于 2007-9-25 15:29 编辑 ] |
|