The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Perl::Critic::Policy::Compatibility::TestMoreLikeModifiers - don't use regexp modifiers with like() tests

DESCRIPTION

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,

    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.

As always if you don't care about __END__ you can always disable TestMoreLikeModifiers from your .perlcriticrc in the usual way,

    [-Compatibility::TestMoreLikeModifiers]

SEE ALSO

Perl::Critic::Pulp, Perl::Critic

HOME PAGE

http://user42.tuxfamily.org/perl-critic-pulp/index.html

COPYRIGHT

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.