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. alexIn reply to Re: Extracting Text Lines
by talexb
in thread Extracting Text Lines
by mikevanhoff
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |