# if ALL CAPS (no lower case), conver to lower case if ( 0 == $text =~ tr/a-z/a-z/ ) { $text =~ tr/A-Z/a-z/; }