Re: Is "lc(or)" something special?

2010-01-28 Thread Uri Guttman
>>>>> "SHC" == Shawn H Corey writes: SHC> Uri Guttman wrote: >> why would mod_perl have anything to do with evaling hardwired values >> inside lc()? i have done plenty of perl code generation (see Sort::Maker >> for one) and you can cont

Re: Is "lc(or)" something special?

2010-01-28 Thread Shawn H Corey
Uri Guttman wrote: > why would mod_perl have anything to do with evaling hardwired values > inside lc()? i have done plenty of perl code generation (see Sort::Maker > for one) and you can control that easily if you take care. the OP had a > fixed value of or (oregon?) inside lc. so s

Re: Is "lc(or)" something special?

2010-01-28 Thread Uri Guttman
>>>>> "SHC" == Shawn H Corey writes: SHC> Uri Guttman wrote: >> my question is why is the OP doing an lc() on a fixed string? and which >> is already lower case! someone mentioned a possible eval but that still >> makes little sense as i

Re: Is "lc(or)" something special?

2010-01-28 Thread Shawn H Corey
Uri Guttman wrote: > my question is why is the OP doing an lc() on a fixed string? and which > is already lower case! someone mentioned a possible eval but that still > makes little sense as it would seem to need to generate that code and > hardwiring a statename as the arg is odd.

Re: Is "lc(or)" something special?

2010-01-28 Thread Uri Guttman
>>>>> "R" == Ruud writes: R> Grant wrote: >> I have a line in a script that lowercases each US state regardless of >> what case the letters are in: >> >> lc($state); >> >> I just saw an error like this: >>

Re: Is "lc(or)" something special?

2010-01-28 Thread Dr.Ruud
Grant wrote: I have a line in a script that lowercases each US state regardless of what case the letters are in: lc($state); I just saw an error like this: Safe: syntax error at (eval 1806) line 1, near "lc(or" lc(or) Which makes me think lc(or) might have some type of speci

Re: Is "lc(or)" something special?

2010-01-27 Thread Grant
>> I have a line in a script that lowercases each US state regardless of >> what case the letters are in: >> >> lc($state); >> >> I just saw an error like this: >> >> Safe: syntax error at (eval 1806) line 1, near "lc(or" >>> lc(or

Re: Is "lc(or)" something special?

2010-01-27 Thread Shawn H Corey
Grant wrote: > I have a line in a script that lowercases each US state regardless of > what case the letters are in: > > lc($state); > > I just saw an error like this: > > Safe: syntax error at (eval 1806) line 1, near "lc(or" >> lc(or) > > Which

Re: Is "lc(or)" something special?

2010-01-27 Thread Jim Gibson
On 1/27/10 Wed Jan 27, 2010 11:53 AM, "Grant" scribbled: > I have a line in a script that lowercases each US state regardless of > what case the letters are in: > > lc($state); > > I just saw an error like this: > > Safe: syntax error at (eval 1806)

Is "lc(or)" something special?

2010-01-27 Thread Grant
I have a line in a script that lowercases each US state regardless of what case the letters are in: lc($state); I just saw an error like this: Safe: syntax error at (eval 1806) line 1, near "lc(or" > > lc(or) Which makes me think lc(or) might have some type of special meanin

Re: Useless use of lc

2005-12-01 Thread Beast
Xavier Noria wrote: On Dec 1, 2005, at 12:48, Beast wrote: How do I avoid this kind of warning? Useless use of lc in void context at ./myscript.pl line 87. Tried to use : lc $string if $string; but still gives warning. I can count with my fingers the times a warning was not triggered

Re: Useless use of lc

2005-12-01 Thread Xavier Noria
On Dec 1, 2005, at 12:48, Beast wrote: How do I avoid this kind of warning? Useless use of lc in void context at ./myscript.pl line 87. Tried to use : lc $string if $string; but still gives warning. I can count with my fingers the times a warning was not triggered by something that

Useless use of lc

2005-12-01 Thread Beast
How do I avoid this kind of warning? Useless use of lc in void context at ./myscript.pl line 87. Tried to use : lc $string if $string; but still gives warning. -- --beast -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <h

Re: lc

2004-02-21 Thread Stuart White
Thanks everyone. I feel sortof like a dope since I knew that to save the results of a function, I'd have to save it in a variable. I just forgot in the excitement of trying to use all the functions in the same line. Someone, I believe Jenda, brought up that the "useless use of lc"

Re: lc

2004-02-21 Thread R. Joseph Newton
Stuart White wrote: > I want to take input from and then convert it > to lowercase. so I tried this: > > lc(chomp($input = ))); Two things here: 1. It is pointless to lc a numerical value, and the boolean value [1 if a newline was removed, 0 otherwise] returned from chomp wi

Re: lc

2004-02-21 Thread Randal L. Schwartz
>>>>> "Stuart" == Stuart White <[EMAIL PROTECTED]> writes: Stuart> The way it is described makes me think that I am using Stuart> it correctly, but Perl is telling me different. Stuart> So, am I using it incorrectly? Thanks You're confusing function

RE: lc

2004-02-21 Thread David le Blanc
> -Original Message- > From: Stuart White [mailto:[EMAIL PROTECTED] > Sent: Saturday, 21 February 2004 9:21 AM > To: Perl Beginners Mailing List > Subject: lc > > I want to take input from and then convert it > to lowercase. so I tried this: > > lc(chom

RE: lc

2004-02-20 Thread Stuart White
The error was: useless use of lc in void context at line 22 I also tried this: lc($input = ); print "$input"; > This won't work though because chomp() returns the > number of newline > characters removed from the string... so in essence > you are trying to > lowerc

Re: lc

2004-02-20 Thread Jenda Krynicky
From: Stuart White <[EMAIL PROTECTED]> > I want to take input from and then convert it > to lowercase. so I tried this: > > lc(chomp($input = ))); > > and I got an error message that said I couldn't use lc > in that way - or something like that. I can't &g

Re: lc

2004-02-20 Thread WilliamGunther
lc() takes a string, turns the string to lower case, and returns that. So what you're searching for is: chomp($input = lc()); This way, lc() function turns the input into lowercase, assigns it to the $input scalar, and then chomps out the newline at the end. Quite efficent. In a me

RE: lc

2004-02-20 Thread Hanson, Rob
> then I tried this: > lc($input); > and I got the same error. This shouldn't give an error. ...It didn't give me one. > so I tried this: > lc(chomp($input = ))); > and I got an error message that said I couldn't use lc > in that way - or something like tha

lc

2004-02-20 Thread Stuart White
I want to take input from and then convert it to lowercase. so I tried this: lc(chomp($input = ))); and I got an error message that said I couldn't use lc in that way - or something like that. I can't remember the message now. then I tried this: lc($input); and I got the same er

RE: lc vs. tr

2001-08-14 Thread Drew Cohan
Thanks to both Peter and register for answering my questions. -- Drew. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Tuesday, August 14, 2001 1:07 PM To: Drew Cohan Cc: [EMAIL PROTECTED] Subject: Re: lc vs. tr Using Benchmark.pm ... the answer is to use

Re: lc vs. tr

2001-08-14 Thread register
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

Re: lc vs. tr

2001-08-14 Thread Peter Scott
At 11:59 AM 8/14/01 -0400, Drew Cohan wrote: >1. Any opinions on which is better to convert characters into lowercase >(efficiency, speed, etc)? > >lc vs. tr /A-Z/a-z/ ? lc can handle locales where upper and lower case isn't the same as A-Z vs a-z. >2. Is there an option

lc vs. tr

2001-08-14 Thread Drew Cohan
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 conve