July 2023 Archives

Matching simply

A little over ten years ago, when Perl 5.18 was approaching its release date, I released match::simple. This was mostly in response to the smartmatch operator (~~) being deprecated, but also a solution to the incredibly arcane rules for how the smartmatch operator operated.

match::simple was intended to be... simpler. The operator looks a little funky because it uses some clever trickery to fake being an infix operator:

    use match::simple;
    
    if ( $this |M| $that ) {
        ...;
    }

About Toby Inkster

user-pic I'm tobyink on CPAN, IRC and PerlMonks.