I think the overall best solution is to mention Try::Tiny in the perldocs.
eval { ...; 1 } or do {...} might be a good solution if you hate dependencies and want backwards compatibility.
But it's just too much boilerplate to keep in mind.
Me too, I forgot about the ;1 part when starting this thread.
But I'm worried about compatibility issues with Try::Tiny and the new try feature in 5.36.
Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery
In reply to Re^2: canonical doc explaing need for "eval { ... } or do {...}" construct
by LanX
in thread canonical doc explaing need for "eval { ... } or do {...}" construct
by LanX
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |