Subject: | Perl::Critic::Policy::Variables::ProhibitPunctuationVars |
Date: | Wed, 26 Aug 2009 09:21:31 +0100 |
To: | bug-Perl-Critic [...] rt.cpan.org |
From: | John O'Brien <jo3 [...] sanger.ac.uk> |
In Version 1.104 the above policy complains about the following code.
$self->{table} .= sprintf " %5d\t%7d %6d\t%2d %-25s\t%s\n",
$self->{workflow_id},
$npgan_job->id_npgan_job(),
$npgan_job->run_id(),
$npgan_job->lane_number(),
$npgan_job->st_library_name(),
$tarball{$npgan_job};
Giving the warning:
"Magic punctuation variable used in interpolated string at line 127,
column 35. See page 79 of PBP."
We have tracked it down to the "%-25s" portion and changing this to
"%25s" removes the warning.
As there is no %- magic variable, is this an error in a regex used for
spotting this kind of policy violation?
John O'Brien
--
The Wellcome Trust Sanger Institute is operated by Genome Research
Limited, a charity registered in England with number 1021457 and a
company registered in England with number 2742969, whose registered
office is 215 Euston Road, London, NW1 2BE.