I have a style question about return statements for small subs. Which of these three do you prefer, and why:
# 1: sub is_connected { return 1 if shift->is_writable } # 2: sub is_connected { return shift->is_writable } # or 3: sub is_connected { return shift->is_writable ? 1 : 0 # or undef, etc. }
In reply to Style question on conditional return statements: by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |