in reply to Re: How do I use a block as an ‘or’ clause instead of a simple die?
in thread How do I use a block as an ‘or’ clause instead of a simple die?
we have to make sure that the last line is always true. Returning 1 does that
Forget the above, it is wrong. As per the docs: return EXPR: Returns from a subroutine, eval, or do FILE with the value given in EXPR
CountZero
A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James
|
|---|