develooper Front page | perl.perl5.porters | Postings from June 2021

More testing / dogfooding of `try` feature

Thread Next
From:
Paul "LeoNerd" Evans
Date:
June 15, 2021 23:20
Subject:
More testing / dogfooding of `try` feature
Message ID:
20210616002003.23588884@shy.leonerd.org.uk
Hi all,

I've recently been looking at a bug with the new try/catch syntax in
core:

  https://github.com/Perl/perl5/issues/18855

It has me thinking that this sort of bug ought really to have been
caught well before 5.34.0, earlier in the 5.33.x development series. I
think a reason it wasn't is because not many people are actually making
use of this. Perhaps understandable given it was "only" a development
release, but now it's out in the wild in a real production version
perhaps there will be more eyeballs on it.

What we need here is more folks to actually use this new feature in
real code to check whether it actually works for real.

So how can you help?

 1) If you're already using `Syntax::Keyword::Try`, simply change that
    to 

       use Feature::Compat::Try;

    This will pull in S-K-T on older perls, or simply enable the
    core 'try' feature on 5.34 onwards.

 2) If you're using some other try-providing syntax module and you
    don't need to support older than 5.34, you can

       use feature 'try';

    and adjust your uses of the syntax accordingly (exactly what
    changes to make will depend on what other module you're already
    using).

    If you do need pre-5.34 compatibility as well, then I suggest using
    Feature::Compat::Try, as per above.

 3) If you don't have any form of module for providing a `try`-like
    syntax and are instead using plain ol' `eva{}`, well then now may
    be a perfect opportunity to give this a test. Either of the above
    techniques would do that - depending whether you need to support
    older than 5.34 or not.

-- 
Paul "LeoNerd" Evans

leonerd@leonerd.org.uk      |  https://metacpan.org/author/PEVANS
http://www.leonerd.org.uk/  |  https://www.tindie.com/stores/leonerd/

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About