in reply to Help With Parsing a File
use strict; my $value = 0; my @linebuf; open IN, "data.file" or die "$!"; for (0..1) { $_ = <IN>; push @linebuf,$_; } while (<IN>) { if (/^--/ and $linebuf[0] =~ /ABC SET/) { print "Matched ",$linebuf[0]; $value++; } shift @linebuf; push @linebuf,$_; } close IN or warn "$!"; print "total found is $value\n";
|
|---|