in reply to How to read a logfile and create a build script
The above is untested, and is assuming that if a successful build occurs#!/usr/bin/perl -w use strict; my $logfile = "/buildarea/logfile.log"; my $buildmsg = ""; open(FH,"$logifle") or die "Can't open $logfile"; $_=<FH>; if(/BUILD SUCCESSFUL/i){ $buildmsg = "BUILD SUCCESSFUL"; close FH; } else{ $buildmsg = $_; while(<FH>){ $buildmsg .= $_; } close FH; }
|
|---|