On Jun 28, [EMAIL PROTECTED] said:
but here is another piece of code I tried and this worked as well
considering the attachment:
comments on the below block?
[snip]
if (m/begin pgp public key block/ig) {
$lc=1;
}
if ( $lc==1){
print $_;
}
if (m/end pgp public key block/ig) {
$lc=0;
}
What comment do you want? This is 100% identical to using a flip-flop,
except that you have an explicit variable holding the truth value. It
starts as false. If the first regex matches, then $lc is true. If $lc is
true, print the current line. If the second regex matches, then $lc is
false.
Identical. Use a flip-flop. It's easier.
--
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>