Update:And I had a typo also. Fixed mine first :-)my $add_at_end; while (<IN>) { $add_at_end = 1 unless s/str1/str2/; print OUT; } print OUT "text" if $add_at_end;
In reply to Re: Re: Conditional replace
by runrig
in thread Conditional replace
by October
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |