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 the negated set, but it doesn't:

$ echo "abcxyz" | perl -plane '$_ =~ y/[^abz]/N/ '
NNcxyN

I know I've done this before.  What am I overlooking?

Regards,
- Robert

-- 
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