in reply to Case conversion

Here's a simple one,

$string =~ tr/AEIOUaeiou/aeiouAEIOU/;
There are lots of ways to do it.

After Compline,
Zaxo

Replies are listed 'Best First'.
Re^2: Case conversion
by VSarkiss (Monsignor) on Sep 01, 2005 at 15:52 UTC
Re^2: Case conversion
by inman (Curate) on Sep 01, 2005 at 15:54 UTC
    Why type y/a-zA-Z/A-Za-z/ when you can type my $inverted = join '', map {$_ = uc eq $_ ? lc : uc} split //, $input;
      Well,
      1. it was about vowels,
      2. also, many people use split like that, but I find that a simple match (in list context) is better suited. In this case, with reference to your example:
        my $inverted = join '', map { whatever } $input =~ /./g;