On Fri, Sep 25, 2009 at 5:46 AM, Shawn H Corey <[email protected]> wrote: > Robert Citek wrote: >> >> How does one transliterate in perl using a negated character class? > > echo "abcxyz" | perl -ple '$_ =~ tr/abz/N/c' > > See `perldoc perlop` and search for /tr\/SEARCHLIST\/REPLACEMENTLIST\/cds/
Thanks. I took a little break from coding which helped clear my mind. That and your reference to the right doc section (instead of an overly vague RTFM) reminded me that I wanted s/// not y///. $ echo "abcxyz" | perl -ple '$_ =~ s/[^abz]/N/g' Regards, - Robert -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected] http://learn.perl.org/
