Subject: | ProhibitFixedStringMatches on qr in function call |
Date: | Sun, 21 Mar 2010 09:34:00 +1100 |
To: | bug-Perl-Critic [...] rt.cpan.org |
From: | Kevin Ryde <user42 [...] zip.com.au> |
In some of my code I had a qr with a set of fixed string matches,
my @items = $twig->descendants(qr/^(item|entry)$/);
which tickled ProhibitFixedStringMatches.
The func is outside my control, so there's not much choice but to pass a
fixed-set regexp. Similar quite possible arises in Test::More::like().
The pod for ProhibitFixedStringMatches could have a few words of
guidance on this sort of thing.
I was going to propose an option that would allow qr in function calls,
but if it's infrequent then just some words in the pod advising either
##nocritic or ways to rewrite for particular modules like Test::More (if
there are good ways) may be enough.