$str =~ s#/## for 1,2; or s#(/\s*){2}\z## for example. But these assume you slurp the entire file into a string. Perhaps you are doing a perl -pe kind of thing... perl -i.old -pe '$sawSlash++ && s#/## if m#/#' (updated again. Thanks, blakem. I added "$str =~" to match what I was thinking and what I had tested.)
- tye (sààaaaà x y z aziez,s $e $s deedeydi,t $ex,print)In reply to (tye)Re: How to make only two of three substitutions?
by tye
in thread How to make only two of three substitutions?
by curtisb
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |