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

Re: disabling smartmatch and when()?

Thread Previous
Paul "LeoNerd" Evans
June 20, 2022 13:53
Re: disabling smartmatch and when()?
Message ID:
On Mon, 20 Jun 2022 14:45:48 +0100
Dave Mitchell <> wrote:

> So...
> A while back, we collectively agreed that the smartmatch operator
> and the when() keyword (which sometimes uses smartmatch under the
> hood), had fundamental design flaws, and we retrospectively made
> ~~/given/when/break experimental in 5.18.0 (nine years ago!).
> Since then we have failed to reach a consensus as to how these should
> be fixed, or indeed whether they should removed altogether. This is an
> unhappy state of affairs.
> I propose that right now (so appearing in 5.38.0), we disable C<~~>
> and when(), and possibly C<given> and C<break> too. Any attempt to
> use them will give a meaningful compile-time error (as opposed to a
> plain syntax error).

Perl 5.36 already took a good step in this direction. From

>>    Finally, with this release, the experimental switch feature,
>>    present in every feature bundle since they were introduced in
>>    v5.10, has been removed from the v5.36 bundle. If you want to use
>>    it (against our advice), you'll have to enable it explicitly.

Paul "LeoNerd" Evans      |  |

Thread Previous Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About