Subject: | ProhibitVersionStrings versus comments within a "use" |
Date: | Mon, 13 Apr 2009 08:49:23 +1000 |
To: | bug-Perl-Critic [...] rt.cpan.org |
From: | Kevin Ryde <user42 [...] zip.com.au> |
In the current cvs ProhibitVersionStrings seems to be triggered by a
3-part version number which is in a comment in a use statement, per
below.
I struck this with some gtk version numbers in comments. The remark in
ProhibitVersionStrings.pm about having PPI parse such numbers is
probably the best idea. Although v-strings are a case of a dubious idea
(floating point verion numbers) made even worse, PPI could helpfully
pick out how perl is going to read such a form.
Index: ProhibitVersionStrings.run
===================================================================
--- ProhibitVersionStrings.run (revision 3285)
+++ ProhibitVersionStrings.run (working copy)
@@ -15,6 +15,10 @@
use lib '/usr/lib/perl5/vendor_perl/5.8.8'; # RT #30388
+use Foo::Interface
+ # as of FooLib 1.2.3 we can use the xyzzy option
+ 'xyzzy' => 1;
+
#-----------------------------------------------------------------------------
## name use failure