in reply to Re^4: canonical doc explaing need for "eval { ... } or do {...}" construct
in thread canonical doc explaing need for "eval { ... } or do {...}" construct

Quite the opposite. It's not any less backward compatible than creating a new module that exports try, seeing as you have to "import" it before you can use it.

  • Comment on Re^5: canonical doc explaing need for "eval { ... } or do {...}" construct
  • Download Code

Replies are listed 'Best First'.
Re^6: canonical doc explaing need for "eval { ... } or do {...}" construct
by LanX (Saint) on May 13, 2022 at 06:20 UTC

      I think you're saying that since the new keyword won't work on older versions, that it's not backwards compatible? That's not what backwards compatibility means.

      Backwards compatibility is the ability to continue to use existing code as-is. The new feature won't change that. Try::Tiny and its users will continue to work perfectly fine, so the feature is backwards compatible.

        It seems two problems were merging in my mind (which is currently overdosed with antibiotics)
        • writing CPAN modules which work on older Perl versions (like - as an extreme case - those notoriously antique Perls on AIX )
        • compatibility of Try::Tiny code after the new try-catch feature leaves the experimental phase.
        The new try-catch has obvious and subtle incompatibilities to Try::Tiny, like the explicit catch ($e) argument.

        First case may need to called differently, probably "Old-Compatibility" ... (I'm eager to learn about a proper naming).

        The sheer number of modules already using Try::Tiny according to hippo make the second case a real "Backwards-Compatibility" issue. Because at some point a feature should become a default.

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