in reply to how do i get the 2nd line when the 1st is matched
The second clause of the if conditional is to prevent the "wrap around" effect of a -1 array subscript.open( FILE, "<data.txt"); my @lines = (<FILE>); close FILE; my $i = 0; for(@lines){ chomp; print $_ if ( $lines[$i-1] =~ /116">$/ ) && ( $i ); $i++; }
|
|---|