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

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...

Replies are listed 'Best First'.
Re^4: Try::Tiny and -E
by LanX (Saint) on Dec 26, 2025 at 18:25 UTC
    > 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.