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

Re: review of perlexperiment, 2021-10

Thread Previous | Thread Next
H.Merijn Brand
October 6, 2021 15:13
Re: review of perlexperiment, 2021-10
Message ID:
On Sun, 03 Oct 2021 23:51:43 +0200, Tomasz Konojacki <> wrote:

> On Sun, 03 Oct 2021 16:41:37 -0400
> "Ricardo Signes" <> wrote:
> > *smartmatch* — We have resisted removing this failure for years, as
> > we want to replace it with something else.  My take:  we should
> > just rip this out and later, *maybe*, put something else in. #13173
> > <>  
> Back in 2017 we tried replacing smartmatch with "dumbmatch" and in
> result we made everyone angry and broke half of CPAN:
> I don't want that to happen again.
> Smartmatch is widely used because of two reasons. First of all, it
> solves an important problem: it provides "switch" and "in" operators.
> Of course, it does that in a completely insane way, but currently
> there are no (core) alternatives to it.

I agree on this statement. And my mind is ambiguous.
As a developer and maintainer of perl I want it gone
As an (end)user I want it to stay, even in its current state: there is
no (easy) alternative, and I have a few (huge) scripts that depend on
it. All of them were converted from insane if/elsif/else trees into
readable switch structures. I really don't feel thrilled to rewrite
them again. (all I use is undef/numeric/string/regex, no overloading,
hashes or arrays).

> The other reason is that we have completely failed to communicate that
> we don't want our users to use smartmatch. Until 5.18 it didn't warn
> at all, now it gives an "experimental" warning which is meaningless.
> Do signatures and smartmatch have the same status? Absolutely not. Yet
> that's what our documentation and warnings say.
> If we want to remove smartmatch, we need to properly deprecate it and
> provide a replacement for it. BTW, I believe LeoNerd is working on the
> latter.
> Speaking of deprecating things, the dumbmatch fiasco has showed that
> our two stable releases deprecation cycle is way too short. When the
> users of LTS distributions upgrade, they skip multiple Perl releases,
> so from their POV features disappear without any warnings! This
> worked OK for unimportant stuff that no one cared about, but I think
> something like smartmatch will need a longer deprecation period.

H.Merijn Brand   Perl Monger
using perl5.00307 .. 5.33        porting perl5 on HP-UX, AIX, and Linux

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