Problems? Is your data what you think it is? | |
PerlMonks |
Re^3: Can I catch a die from someone else's module?by kcott (Archbishop) |
on Apr 20, 2022 at 00:00 UTC ( [id://11143114]=note: print w/replies, xml ) | Need Help?? |
"Do I need the 1;?" ++ Good question. I would always include it. If you think other maintainers may not understand its importance, add a comment like:
Even in situations when the last statement in the eval block evaluates to 1, or some other TRUE value, I would include it:
Otherwise, if someone removes the '$x = 1;' line, or changes the value, but does not know, or forgets, to add the '1;' statement, the 'eval {...} or do {...};' construct may be broken. — Ken
In Section
Seekers of Perl Wisdom
|
|