http://www.perlmonks.org?node_id=162175


in reply to Re: Can If-then conditions do ($a = $b = $c) type expressions?
in thread Can If-then conditions do ($a = $b = $c) type expressions?

I will certainly agree that this works.

I also say this is not obvious at all, and I defy you to remember 6 months from now what in the world you were trying to do. The code

# Test if $a, $b, and $c are equal # to the same number if ($a == $b && $a == $c) { print "Three agree\n"; } else { print "Three don't agree\n"; }
is clear, easy to read, and understandable to anyone who would be in position to maintain your code.

Cool code is fun, but maintaining cool code is a nightmare.