Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: canonical doc explaing need for "eval { ... } or do {...}" construct

by Discipulus (Canon)
on May 10, 2022 at 11:08 UTC ( [id://11143737]=note: print w/replies, xml ) Need Help??


in reply to canonical doc explaing need for "eval { ... } or do {...}" construct

Hello LanX,

it is already linked, but for me this by them is canonical enough for me :)

Lamentably our docs are at least suboptimal: why dont you fork perldoc and add a paragraph in eval ? I'm sure you can phrase it correctly.

After the PR you can point your collegues to standard documentation.

L*

There are no rules, there are no thumbs..
Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.
  • Comment on Re: canonical doc explaing need for "eval { ... } or do {...}" construct
  • Download Code

Replies are listed 'Best First'.
Re^2: canonical doc explaing need for "eval { ... } or do {...}" construct
by LanX (Saint) on May 12, 2022 at 13:29 UTC
    Thank you all! :)

    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

      But I'm worried about compatibility issues with Try::Tiny and the new try feature in 5.36.

      According to MetaCPAN there are 15,409 dists depending ultimately on Try::Tiny. I credit those steering the good ship Perl with enough nous to realise that breaking this would be an absolute no-go.


      🦛

      I think the overall best solution is to mention Try::Tiny in the perldocs.

      hmmm, the Perl docs probably should be in the business of recommending specific non-core modules.

      Especially since Perl is getting a try keyword...

        > Especially since Perl is getting a try keyword...

        which is naturally not backwards compatible

        Cheers Rolf
        (addicted to the Perl Programming Language :)
        Wikisyntax for the Monastery

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (5)
As of 2024-04-19 05:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found