in reply to Re: Catching error in DateTime::Format
in thread Catching error in DateTime::Format

Or
use 5.040; try { .... } catch { return undef }
In 5.34 to 5.48, it's experimental and requires suppressing experimental warnings; using finally remains experimental; see https://perldoc.perl.org/perlsyn#Try-Catch-Exception-Handling.

Replies are listed 'Best First'.
Re^3: Catching error in DateTime::Format
by hippo (Archbishop) on Oct 30, 2025 at 09:47 UTC
    use 5.040; ... In 5.34 to 5.[3]8 ...

    Or just use Feature::Compat::Try and save any bother over which version of perl might be running it.


    🦛

Re^3: Catching error in DateTime::Format
by ikegami (Patriarch) on Oct 30, 2025 at 02:09 UTC

    5.48 should be 5.38