Avoid Yoda conditions in Perl you should

Not just Perl; this used to be fairly common in C. Eventually we developed the convention that if you really did mean to assign and compare the results of that, as in if (c = getc()) you would wrap it in an extra set of parentheses, like if ((c = getc())). Then, the compiler would use that as a “yes I really meant to do that” signal.

On the other claw, Perl never was exactly famous for readability…

2 Likes