Hello,

I have a text whose content is like:

aabbbbaa
bbaaaabbaa
aaxxxbb
bb776yhghhaa


I want to switch all "aa" and "bb".
 I can handle this use regex:

s/aa|bb/$& eq 'aa'?'bb':'aa'/ge;


But how to use 'tr' doing that?

Thanks.

//Xiao lan

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to