Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Perl-Critic CPAN distribution.

Report information
The Basics
Id: 14817
Status: resolved
Priority: 0/
Queue: Perl-Critic

People
Owner: thaljef [...] cpan.org
Requestors: chris+rt [...] chrisdolan.net
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.08_02
Fixed in: 0.10



Subject: Single paren in quoted string triggers "noisy string" warning
The following code snippet package Foo; use warnings; use strict; my $f = '(' . ')'; 1; triggers these warnings, which I think are false positives: Quotes used with a noisy string at line 4, column 9. See page 53 of PBP. Quotes used with a noisy string at line 4, column 15. See page 53 of PBP. On page 54 of PBP, Damian suggests that the following is OK: my $printable_list = '(' . join(q{,}, @list) . ')'; indicating that quoted single parens are OK. In fact, I think that the q{} notation with any brace (like q{(} ) is much harder to read. So, I would suggest that bracing characters be excluded from this policy. Perhaps change this code in lib/Perl/Critic/Policy/ValuesAndExpressions/ProhibitNoisyQuotes.pm my @matches = grep { m{\A ["|'] \W{1,2} ['|"] \z}x } @{$doubles_ref}, @{$singles_ref}; to this: my @matches = grep { m{\A ["|'] [^\w(){}[\]<>]{1,2} ['|"] \z}x } @{$doubles_ref}, @{$singles_ref}; (Also, I'm curious why the ["|'] changes to ['|"] in the above. Is there a reason, like making a text editor happy, or is that a typo?)
Done in version 0.10. Parens, braces, and brackets are ok in quotes.