in reply to Case conversion

I should probably phase this a bit better. I have a varible and this can be in either lower or upper case. For me to use this variable it needs to be in upper case. What I would like to achieve is to convert the variable to upper case if it is currently lower case otherwise just use it as it is. I hope that's better

Replies are listed 'Best First'.
Re: Re: Case conversion
by spurperl (Priest) on Mar 31, 2003 at 07:50 UTC
    The simplest (and thus probably the desired) solution is to use uc anyway, it won't modify upper-case strings and will only turn lower-case to upper-case.

    Try:
    perl -e 'print "hello " . uc "WOrld"'