On Mar 30, R. Joseph Newton said: >Jeff 'japhy' Pinyan wrote: > >> The main problem is the PRECEDENCE. Your ? : line is run like so: >> >> ((++$count) ? ($count += $count--) : $count) += $count++; > >Have you tested this? I don't see the precedence issue happening here. >Could you try duplicating these reults with code explicitly specifying >the precedence you show? I do not think you are going to find that the >outer parentheses you show represent the actual precedence. Remember >that the ? and : are not different operators, but different parts of the >same operator. If the += operator has a higher precedence than ?, it >will also have a higher precedence than :.
Yes, I have tested it, and it's documented. ?: binds TIGHTER than +=. -- Jeff "japhy" Pinyan [EMAIL PROTECTED] http://www.pobox.com/~japhy/ RPI Acacia brother #734 http://www.perlmonks.org/ http://www.cpan.org/ CPAN ID: PINYAN [Need a programmer? If you like my work, let me know.] <stu> what does y/// stand for? <tenderpuss> why, yansliterate of course. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>