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


in reply to Re: Coding superstitions
in thread Coding superstitions

...those semicolons aren't necessary either (nor are the braces, now that I think about it).
You're correct about the semicolons, but the braces are necessary. The if-else construct in Perl controls BLOCKs, not statements. Take a look at perldoc:perlsyn. This avoids the dangling-else ambiguity.

Don't confuse this with the if modifier, which comes at the end of statements, not BLOCKs.

I'll let good brother tilly take you to task for (probably inadvertently) passing your current @_ when calling yes and no. ;-)