http://qs321.pair.com?node_id=279261


in reply to Re: Re: Finding and extracting lines of text
in thread Finding and extracting lines of text

so just throw away the first two lines. Here's a quick fix on ajdelore's code

$success = 0; open(FILE,"dumptape.log") or die ("Could not open file"); while(<FILE>) { if (/Dump phase number 3/) { print; <FILE> for (1..2); print <FILE>; $success = 1; last; } } if(!$success) { print "Failed dump log\n"; #do other failed dump log stuff here } close FILE;

It seems like you have an understanding of some areas of perl, but are lacking some of the basics. You should look for an online tutorial (or better, one of the O'Reilly books), to pick up on a few of the little things you're missing.