use strict; # determine case of a character # and return appropriate 'control' code. sub get_escape_case { my ($char) = @_; if ($char eq "\U$char") { return '\U'; } else { return '\L'; } } # this wouldn't work... print get_escape_case("S")."stuff\n"; # while this works.. print "\Ustuff\n";