in reply to Replacing a character in a string

Even if you didn't know about ucfirst, it's easy enough to do with quoting:

"\u$_"

Or with a regex, if you didn't know about that either, but that's weird.

s/(.)/uc$1/e

Replies are listed 'Best First'.
Re^2: Replacing a character in a string
by ikegami (Patriarch) on Nov 15, 2005 at 21:27 UTC

      As long as we're getting silly ...

      $s &= ~' ';
      (Warning: may not work for non-7-bit-ASCII letters such as accented characters, Cyrillic characters, or anything in EBCDIC. Or even any characters that aren't actually letters. But it is fun to do.)

        Cute :)