Using Benchmark.pm ... the answer is to use lc ... if you flip through to the
Perl Cookbook pg 19 or receipe 1.9 you will find that tr is the wrong way to
do changing of case (or at least tr/A-Z/a-z/ since it will miss accented
characteers and so on..)

THe reason you are getting the error is because you did not capture lc's
return value.  unlike chomp lc does not work on the argument and the return
value is the converted string ...

On Tue, Aug 14, 2001 at 11:59:54AM -0400, Drew Cohan shaped the electrons to read:
> 1.  Any opinions on which is better to convert characters into lowercase
> (efficiency, speed, etc)?
> 
> lc vs. tr /A-Z/a-z/  ?
> 
> 2.  Is there an option to tell tr to ignore case?  as in:
> 
> tr/abc/222/i; #translates regardless of case
> 
> 3.  If #2 isn't possible, how would you use lc to convert to lowercase
> before using tr/abc/222/, as in:
> 
> while (<>)
> {
>       # trying to convert $_ to lowercase using lc before using tr/// function
>       lc;
>       tr/abc/222/;
>       print;
> }
> 
> This code produces an error "Useless use of lc in void context".  How do I
> successfully combine these three lines of code?
> 
> TIA,
> 
> -- Drew
> 
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to