my $char = 'A'; my $num = -64 + ord uc $char; $char = chr(64 + $num); # Translate back (to uppercase)