match::simple
simplified clone of smartmatch operator
- Provided by: libmatch-simple-perl (Version: 0.004-1)
- Report a bug
simplified clone of smartmatch operator
use v5.10;
use match::simple;
if ($this |M| $that)
{
say "$this matches $that";
}
match::simple provides a simple match operator "|M|" that acts like a sane subset of the (as of Perl 5.18) deprecated smart match operator. Unlike smart match, the behaviour of the match is determined entirely by the operand on the right hand side.
If you don't like the crazy Sub::Infix operator, you can alternatively export a more normal function:
use v5.10;
use match::simple qw(match);
if (match($this, $that))
{
say "$this matches $that";
}
Please report any bugs to <http://rt.cpan.org/Dist/Display.html?Queue=match-simple>.
match::smart.
This module uses Exporter::TypeTiny.
Toby Inkster <tobyink@cpan.org>.
This software is copyright (c) 2013 by Toby Inkster.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.