Perl::Critic::Policy::Compatibility::TestMoreLikeModifiers - don't use regexp modifiers with like() tests
This policy is part of the Perl::Critic::Pulp addon. It warns about regexp modifiers like /i and /m passed to like tests with Test::More, because such modifiers don't end up propagated to the test until Perl 5.10. For example,
/i
/m
like
Test::More
use Test::More tests => 1; like ('My String', qr/str/i); # bad like ("abc\ndef\n", '/^abc$/m'); # bad
If you've got an explicit use 5.010 or similar then you'll only be running and this check is not applied.
use 5.010
As always if you don't care about __END__ you can always disable TestMoreLikeModifiers from your .perlcriticrc in the usual way,
__END__
TestMoreLikeModifiers
[-Compatibility::TestMoreLikeModifiers]
Perl::Critic::Pulp, Perl::Critic
http://user42.tuxfamily.org/perl-critic-pulp/index.html
Copyright 2008, 2009, 2010 Kevin Ryde
Perl-Critic-Pulp is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version.
Perl-Critic-Pulp is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with Perl-Critic-Pulp. If not, see http://www.gnu.org/licenses.
To install Perl::Critic::Pulp, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Perl::Critic::Pulp
CPAN shell
perl -MCPAN -e shell install Perl::Critic::Pulp
For more information on module installation, please visit the detailed CPAN module installation guide.