Beefy Boxes and Bandwidth Generously Provided by pair Networks
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??


in reply to Re^2: Can I catch a die from someone else's module?
in thread Can I catch a die from someone else's module?

"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:

eval { ...; 1; # IMPORTANT! Do not remove. See: https://www.perlmonks.org/?nod +e_id=11143055 } or do { ...; };

Even in situations when the last statement in the eval block evaluates to 1, or some other TRUE value, I would include it:

eval { ...; $x = 1; 1; } ...;

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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11143114]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (5)
As of 2024-04-26 08:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found