Re: transliterate the negative character class in perl

2009-09-25 Thread Uri Guttman
> "RC" == Robert Citek writes: RC> On Fri, Sep 25, 2009 at 5:46 AM, Shawn H Corey 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 se

Re: transliterate the negative character class in perl

2009-09-25 Thread Robert Citek
On Fri, Sep 25, 2009 at 5:46 AM, Shawn H Corey 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 l

Re: transliterate the negative character class in perl

2009-09-25 Thread Uri Guttman
> "SHC" == Shawn H Corey writes: SHC> echo "abcxyz" | perl -ple '$_ =~ tr/abz/N/c' you don't need the $_ there as tr/// will default to using it. uri -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org

Re: transliterate the negative character class in perl

2009-09-25 Thread Shawn H Corey
Robert Citek wrote: How does one transliterate in perl using a negated character class? For example, I have a string abcxyz and I would like to turn it into abNNNz. I've been able to do the following: $ echo "abcxyz" | perl -plane '$_ =~ y/[abz]/N/ ' NNcxyN so I figured negating would give me

Re: transliterate the negative character class in perl

2009-09-25 Thread Uri Guttman
> "RC" == Robert Citek writes: RC> How does one transliterate in perl using a negated character class? RC> For example, I have a string abcxyz and I would like to turn it into RC> abNNNz. I've been able to do the following: RC> $ echo "abcxyz" | perl -plane '$_ =~ y/[abz]/N/ ' RC>