On Jun 28, [EMAIL PROTECTED] said:
for (;<FH>;) {
if (/^-{5,}(\w+)/ig) {
print $_;
}
$lc++;
}
I want to print everything from BEGIN TO END and right now all I am
printing is the begin and end lines.
If that's what you want, you should use two regexes with the .. operator:
while (<FH>) { # this is better-looking than 'for (;<FH>;)'
if (/^-----BEGIN/ .. /^-----END/) {
print;
}
}
The flip-flop operator (..) is *false* UNTIL the left expression evaluates
to true. THEN it STAYS *true* until the right expression evaluates to
true.
--
Jeff "japhy" Pinyan % How can we ever be the sold short or
RPI Acacia Brother #734 % the cheated, we who for every service
http://japhy.perlmonk.org/ % have long ago been overpaid?
http://www.perlmonks.org/ % -- Meister Eckhart
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>