>>>>> "SHC" == Shawn H Corey <shawnhco...@gmail.com> 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 control that easily if you take care. the OP had a
  >> fixed value of or (oregon?) inside lc. so some code had lc($state) where
  >> $state was 'or' already. why was that code evaled with the state name
  >> hard wired?

  SHC> It's the difference between:

  SHC>   eval 'lc($state)';

  SHC> and:

  SHC>   eval "lc($state)";

those are different at all levels and modperl has nothing to do with
it. it still makes no sense unless some code is being generated. modperl
loads code like everything else, require/use/do. sure it does an eval
but over the entire file and that sort of thing won't happen if the code
works, it works (not counting modperl wierdness in other areas). you
don't get lc(or) without a serious mistake or some odd code generation
happening. something set the $state and later the code was evaled in a
different timeframe.

  SHC> If the code is not run under `use strict;` then the second one works the
  SHC> same as the first except when $state has a value that might be
  SHC> interpreted as a keyword.  With `use strict;`, it would give a different
  SHC> error message.

  SHC> I don't use mod_perl but you do have to be careful when you use it.

as i keep saying, i can't see how modperl has anything to do with
this. i will keep quiet until the OP posts some more and wider code
showing how this happened. he only asked about the silly syntax error
since 'or' is an op when a bareword. lc(or) is a mistake at a deeper
level than just a syntax error. that is what i want to correct.

uri

-- 
Uri Guttman  ------  u...@stemsystems.com  --------  http://www.sysarch.com --
-----  Perl Code Review , Architecture, Development, Training, Support ------
---------  Gourmet Hot Cocoa Mix  ----  http://bestfriendscocoa.com ---------

-- 
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