if (int rand(2)) { $string =~ tr/AEIOUaeiou/aeiouAEIOU/; } else { $string =~ tr/AEIOUYaeiouy/aeiouyAEIOUY/; }