in reply to Conditional replace
Something like this?
my $add_at_end = 1; while( my $ln = <IN> ) { if( $ln =~ s/str1/str2/ && $add_at_end ) { $add_at_end = 0; } print OUT $ln; } print OUT "text" $add_at_end;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Conditional replace
by runrig (Abbot) on Aug 24, 2001 at 04:38 UTC |