in reply to Re: tr/<mixed string>/<UPPER STRING>/
in thread tr/<mixed string>/<UPPER STRING>/

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}

Replies are listed 'Best First'.
Re^3: Converting String to Upper-Case
by tadman (Prior) on Sep 26, 2002 at 17:47 UTC
    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.
Re: Re: Re: tr/<mixed string>/<UPPER STRING>/
by fglock (Vicar) on Sep 26, 2002 at 18:09 UTC

    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?