# input phn .. .. # 1ordUsed the following:
if (/phn_a/ ... /1ord/) {
print OUT $_; }
But this prints out the first finding of phna_ through to first 1ord. 5 lines separate these patterns in the text file
Tried this also, but this seems to starts printing from a poisiton i dont expect it to:
$nLines = 5 if ( /1ord$/ );
print OUT if $nLines-- > 0;
print OUT unless (/phn_a/ .. /1ord/);UPDATE: more detailed:
#!/usr/bin/perl
use strict;
use warnings;
while () {
print unless (/phn/ .. /1ord/);
}
__DATA__
black
# input phn
blue
red
green
# 1ord
yellow
white
# phn .. .. # xxxxx # phn .. .. # 1ordso here the code would onit both rather than just the second?
perlmonks.org content © perlmonks.org and Anonymous Monk, neniro
prlmnks.org © 2006 edmund von der burg (eccles & toad)
v 0.03