good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Given how often I hear about (even experienced) programmers mistakenly typing "=" in an if statement when they meant "==", I don't know if encouraging this particular idiom as a rare case where it is indeed what you mean is a good idea. Might I suggest this instead:
As an aside, I was actually surprised that the version with if didn't warn about the single "=", but a little testing showed that the warning only appears to happen if you mistakenly assign (instead of compare) a literal value, not a subroutine. -xdg Code written by xdg and posted on PerlMonks is public domain. It is provided as is with no warranties, express or implied, of any kind. Posted code may not have been tested. Use of posted code is at your own risk. In reply to Re: For clarity and cleanliness, I'd recommend...
by xdg
|
|