in reply to Re^4: Corrector
in thread Corrector
Technically correct if the OP's true intention was to replace only the first occurrence of each item in each line where it occurs. I tend to believe the OP probably wanted to replace all occurrences, not just one per line. I know you, jdporter (dmorgo bows) already know what character is missing ;-) but for the OP's benefit, adding a 'g' modifier would do the trick:
#!/usr/bin/perl -pi s/this/that/g; # substitutes this with that s/one/two/g; # substitutes one with two
|
---|
In Section
Cool Uses for Perl