On 1/27/10 Wed  Jan 27, 2010  11:53 AM, "Grant" <emailgr...@gmail.com>
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) line 1, near "lc(or"
>> 
>> lc(or)
> 
> Which makes me think lc(or) might have some type of special meaning
> that I need to escape.  Does it, and if so, how can I escape it?

The lc function expects a scalar argument. 'or' without surrounding quotes
is not a string but an operator that expects to be located between two
scalar expressions. So the error is that you have an expression (or) that
consists of a single operator and no operands. Try 'lc("or");' instead.

Perhaps you have attempted to eval a string containing something like
lc($state) after $state has been interpolated to the string 'or'.





-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to