in reply to Extracting Text Lines
It seems to me that you could simplify the code like this.
open(FILE,"dumptape.log") || die ("Could not open file: $!"); my $success; for ( $success = 0; $success != 1 && <FILE>; ) { if ( /Dump phase number 3/ ) { print <FILE>; $success = 1; } } close ( FILE ); if ( !$success ) { print "Failed dump log\n"; #do other failed dump log stuff here }
Then again, maybe checking for success every time is overkill -- the last that you had in there works fine.
--t. alex
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Extracting Text Lines
by Cine (Friar) on Jul 31, 2003 at 15:14 UTC |