in reply to Re: Try::Tiny and -E
in thread Try::Tiny and -E

Opened https://rt.cpan.org/Ticket/Display.html?id=172434.


The way forward always starts with a minimal test.

Replies are listed 'Best First'.
Re^3: Try::Tiny and -E
by LanX (Saint) on Dec 26, 2025 at 14:49 UTC
    Thank you.

    In hindsight it might be that Try::Tiny is complied before the -E takes effect.

    Not sure about the compilation order here. °

    In that case only something like an INIT {} block could catch the conflict.

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

    °) redefining a built-in should fail...

      > In hindsight it might be that Try::Tiny is complied before the -E takes effect.

      Indeed. In this special case it's actually too early to check from within Try::Tiny.

      I checked with feature::feature_enabled("try"); and feature::features_enabled($LEVEL); for various levels.

      But the case of perl -E'use Try::Tiny; try {1/0}' could be checked, and from what I see is Try::Tiny not attempting to catch this.

      So haarg's reply to the ticket is not fully correct.

      On another note: I'm wondering, shouldn't Perl warn if a built-in is clashing with an (exported) sub???

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

      EDIT

      Ticket updated.