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

Re: disabling smartmatch and when()?

Thread Previous | Thread Next
Leon Timmermans
June 20, 2022 16:36
Re: disabling smartmatch and when()?
Message ID:
On Mon, Jun 20, 2022 at 4:44 PM Dave Mitchell <> wrote:

> > If you actually want to remove it, then I'm *strongly* opposed. We can't
> > remove smartmatch until we provide a replacement *and* it goes through a
> > proper deprecation cycle (and by "proper" I mean much longer than the
> > usual 2 release cycles).
> It's gone through a 9 year deprecation cycle, with a mandatory
> experimental warning that you have to explicitly disable.

My understanding is that it can change, not that it's dropped entirely.

> Whether we remove it or change it, its going to break any existing code
> which uses it.

In my experience there's a small subset of the functionality that we can't
afford to drop: when ("string"), when (1) (but note that this will
generally work fine if it does stringwise equivalence), when (/regex/) and
when (undef).

The other 90% we can probably drop without much issues I suspect.

> > Smartmatch is *very* widely used in production code and we *completely*
> failed
> > to communicate that it's on its way out.
> We have been telling people not to use it for nearly a decade.

Not unambiguously. We've left them puzzled mostly.


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