On Sep 14, Christopher Spears said:
In the script I am writing, I use the following
regular expression:
$pass =~ tr/a-z/A-Z/s;
If I give the expression a string like "Occ", then the
expression will convert it to "OC" instead of "OCC"!
What is going on?
It sounds like you're using an operator you don't understand. tr/// is a
character translation operator; it has nothing to do with regexes. The /s
modifier to tr/// tells it to squash consecutive identical characters into
one.
I think you just want to use the uc() function, to convert a string to
uppercase.
perldoc -f uc
--
Jeff "japhy" Pinyan % How can we ever be the sold short or
RPI Acacia Brother #734 % the cheated, we who for every service
http://www.perlmonks.org/ % have long ago been overpaid?
http://princeton.pm.org/ % -- Meister Eckhart
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>