>>>>> "r" == rkb  <[email protected]> writes:

  r> Lawrence Statton wrote:
  >> 
  >> On Mar 29, 2010, at 10:54 AM, [email protected] wrote:
  >>> 
  >>> I looked through perlop and was unable to find where it
  >>> stated that the ternary operator should only be used in
  >>> an
  >>> assignment such as you've shown.  Can you point out
  >>> where
  >>> that's located.
  >>> 
  >> 
  >> In my reasonably-arrogant opinion:  That's kind of
  >> embedded in the
  >> DEFINITION of the word "operator"
  >> 
  r> Just because it's an operator, doesn't mean that it must
  r> and only be used in an assignment.

  r> By your/the DEFINITION of the word "operator", then the ..
  r> range operator must also only be used in an assignment,
  r> which we know is not true.

not the case. it is an expression which returns a value. yes, some ops
themselves do side effects (e.g. s///) but that is the
exception. operators are used to build expressions which return values. 

  r> I have no problem following advice, provided there is good
  r> reason.  So far, you have not provided any reason why I
  r> should change my approach, nor have you shown a better
  r> approach.


how about learning from those who know more perl than you? i already
showed how to do a proper dispatch without ?:. 

did you read my post about the precedence choice of ?: ?

uri

-- 
Uri Guttman  ------  [email protected]  --------  http://www.sysarch.com --
-----  Perl Code Review , Architecture, Development, Training, Support ------
---------  Gourmet Hot Cocoa Mix  ----  http://bestfriendscocoa.com ---------

-- 
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
http://learn.perl.org/


Reply via email to