Acme-CPANModules-SmartMatch

 view release on metacpan or  search on metacpan

README  view on Meta::CPAN

    In perl 5.38 (2023) smart match is deprecated. You can no longer silence
    the warning with "use experimental 'smartmatch'" and must replace the
    use of smart match with something else.

    Perl 5.42 (planned 2025) will finally remove smart match, resulting in a
    syntax error if you still use it.

    Modules

    However, if you still miss smart matching, some modules have been
    written to give you the same/similar feature.

    match::smart (by TOBYINK, first released 2013, pure-perl) gives you a
    similar behaviour to perl's own "~~". It can be used as the "|M|"
    operator or as the match() function.

    Switch::Back (by DCONWAY, first released in June 2024, pure-perl).
    Written by one of the designers of Perl 6, Switch::Back offers roughly
    the same feature set as the old "switch" and smartmatching. Although
    there's no longer "~~", just the smartmatch() function. So basically
    what match::smart offers, but 11 years later.

    match::simple (by TOBYINK which is also the author of "match::smart",
    first released in 2013, in the same distribution as "match::smart",
    available in XS as well as pure-perl) offers a simplified version of
    smart matching. It has 8 kinds of behaviors depending only on the
    /right/ hand side.

    Also see match::simple::sugar which gives you "when", "then", and

README  view on Meta::CPAN

    required beyond that are considered a bug and can be reported to me.

COPYRIGHT AND LICENSE
    This software is copyright (c) 2024, 2023 by perlancar
    <perlancar@cpan.org>.

    This is free software; you can redistribute it and/or modify it under
    the same terms as the Perl 5 programming language system itself.

BUGS
    Please report any bugs or feature requests on the bugtracker website
    <https://rt.cpan.org/Public/Dist/Display.html?Name=Acme-CPANModules-Smar
    tMatch>

    When submitting a bug or request, please include a test-file or a patch
    to an existing test-file that illustrates the bug or desired feature.

lib/Acme/CPANModules/SmartMatch.pm  view on Meta::CPAN

warning with "use experimental 'smartmatch'" and must replace the use of smart
match with something else.

Perl 5.42 (planned 2025) will finally remove smart match, resulting in a syntax
error if you still use it.


**Modules**

However, if you still miss smart matching, some modules have been written to
give you the same/similar feature.

<pm:match::smart> (by TOBYINK, first released 2013, pure-perl) gives you a
similar behaviour to perl's own `~~`. It can be used as the `|M|` operator or as
the `match()` function.

<pm:Switch::Back> (by DCONWAY, first released in June 2024, pure-perl). Written
by one of the designers of Perl 6, Switch::Back offers roughly the same feature
set as the old `switch` and smartmatching. Although there's no longer `~~`, just
the `smartmatch()` function. So basically what <pm:match::smart> offers, but 11
years later.

<pm:match::simple> (by TOBYINK which is also the author of `match::smart`, first
released in 2013, in the same distribution as `match::smart`, available in XS as
well as pure-perl) offers a simplified version of smart matching. It has 8 kinds
of behaviors depending only on the /right/ hand side.

Also see <pm:match::simple::sugar> which gives you `when`, `then`, and `numeric`

lib/Acme/CPANModules/SmartMatch.pm  view on Meta::CPAN

In perl 5.38 (2023) smart match is deprecated. You can no longer silence the
warning with "use experimental 'smartmatch'" and must replace the use of smart
match with something else.

Perl 5.42 (planned 2025) will finally remove smart match, resulting in a syntax
error if you still use it.

B<Modules>

However, if you still miss smart matching, some modules have been written to
give you the same/similar feature.

L<match::smart> (by TOBYINK, first released 2013, pure-perl) gives you a
similar behaviour to perl's own C<~~>. It can be used as the C<|M|> operator or as
the C<match()> function.

L<Switch::Back> (by DCONWAY, first released in June 2024, pure-perl). Written
by one of the designers of Perl 6, Switch::Back offers roughly the same feature
set as the old C<switch> and smartmatching. Although there's no longer C<~~>, just
the C<smartmatch()> function. So basically what L<match::smart> offers, but 11
years later.

L<match::simple> (by TOBYINK which is also the author of C<match::smart>, first
released in 2013, in the same distribution as C<match::smart>, available in XS as
well as pure-perl) offers a simplified version of smart matching. It has 8 kinds
of behaviors depending only on the /right/ hand side.

Also see L<match::simple::sugar> which gives you C<when>, C<then>, and C<numeric>

lib/Acme/CPANModules/SmartMatch.pm  view on Meta::CPAN


=head1 COPYRIGHT AND LICENSE

This software is copyright (c) 2024, 2023 by perlancar <perlancar@cpan.org>.

This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.

=head1 BUGS

Please report any bugs or feature requests on the bugtracker website L<https://rt.cpan.org/Public/Dist/Display.html?Name=Acme-CPANModules-SmartMatch>

When submitting a bug or request, please include a test-file or a
patch to an existing test-file that illustrates the bug or desired
feature.

=cut



( run in 0.244 second using v1.01-cache-2.11-cpan-4d50c553e7e )