in reply to How to read a logfile and create a build script

Try putting the entire contents of the file into a scalar variable and checking that variable for a match on SUCCESS or FAILED. Then assign values to $buildmsg accordingly. Example:
#!/usr/bin/perl open( FH, "filename" ) || die "No way man\n"; while ( <FH> ) { $data .= $_; } if ( $data =~ m/failed/i ) { $buildmsg = $data; } else { $buildmsg = "BUILD SUCCESSFUL"; } # continue
I didn't test this but the idea should work. - kel -