http://qs1969.pair.com?node_id=98991


in reply to Operator Precedence

For the reasons above, don't agree about your position. But I submit that the example you mention refers to the intelligent use of idiom and not the general case that is conjured up by your suggestion that Perl programmers should be considered illiterate unless they can perfectly apply the precedence tables in all situations, and that they should always want to do so to the fullest possible extent (a canard).

Perl is all about using (private) idiom to match personal style and increase efficiency. So in that sense I agree, example 3 seems easier to understand (to me). I think I've probably used all three examples in similar situations depending on how I thought about the problem, which is the point.

But the other two examples would be fine too if separated by whitespace/linefeeds, depending on temperament. This is a question not of how well someone knows precedence but about personal style. I am not sure that your personal style depends more on precedence rules than some other people here.

That said, I lost faith in the infallibility of precedence rules when I heard they were going to be "redefined". Maybe there is a fine (subjective) line between common knowledge and the esoteric in this case but as you can see from the comments everyone comes at Perl from a different angle and often there are good reasons for not exploiting that knowledge.