note
johngg
<p>You can use [doc://chop] to remove a character from the end of a string, it works on <c>$_</c> by default. I assume that you don't want to get rid of the line terminator so I remove it first using [doc://chomp] then it gets replaced by [doc://say] when the line is printed.</p>
<code>
johngg@abouriou:~/perl/Monks$ perl -Mstrict -Mwarnings -E '
open my $inFH, q{<}, \ <<__EOD__ or die $!;
this line does not match
this SUM is wrong
__EOD__
say q{};
while ( <$inFH> )
{
chomp;
do {
say;
next;
} unless m{SUM};
chop; chop; say;
}
close $inFH or die $!;'
this line does not match
this SUM is wro
</code>
<p>I hope this is helpful.</p>
<!-- Node text goes above. Div tags should contain sig only -->
<div class="pmsig"><div class="pmsig-401112">
<p>Cheers,</p><p>JohnGG</p>
</div></div>
11123061
11123061