in reply to tr/<mixed string>/<UPPER STRING>/

Or of course there is:

uc();
or.
"\U$_"

Replies are listed 'Best First'.
Re: Re: tr/<mixed string>/<UPPER STRING>/
by thelenm (Vicar) on Sep 26, 2002 at 16:29 UTC
    Yes, and in fact uc is a more robust solution than tr/a-z/A-Z/ because it respects the current locale and Unicode uppercase mappings. ++Helter

    -- Mike

    --
    just,my${.02}

      I'll second that thumbs-down for using tr. The instant you throw in accented words, you're going to cause mayhem. "RESUMé" being a simple example.

      How about this?
      % perl -pi -e '$_=uc' file1 file2 ...
      Careful where you aim it, because it modifies the files in place. Remember to make backups first if you're wary.

      In order to make \U work with accented chars I had to start my program like this:

      $loc = 'pt_PT.ISO_8859-1'; # my locale $ENV{'LANG'} = $loc; $ENV{'LC_ALL'} = $loc; $ENV{'LOCPATH'} = '/usr/share/locale'; use locale; require POSIX; POSIX::setlocale(&POSIX::LC_ALL, $loc);

      Is there a shorter way?