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: 16321
Status: resolved
Priority: 0/
Queue: Perl-Critic

People
Owner: thaljef [...] cpan.org
Requestors: Bernhard.Schmalhofer [...] gmx.de
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.13
Fixed in: 0.13_01



Subject: Empty strings in ProhibitQuotedWordLists
Hi, I just enabled the CodeLayout::ProhibitQuotedWordLists policy. The only thing it reported was: my @line = ( '', '', '' ); Changing it to the recommened. my @line = ( q{}, q{}, q{} ); didn't help. So I ended up with: my @line = ( q{}, q{}, q{} ); ## no critic So I put a wish for an explict check for empty strings on the wishlist.
I think its fair to call that a bug. The Policy is intended to encourage people to use qw(). But that obviously won't work if any of the "words" are empty or white-space strings. So I think we can fix this Policy to be a little more specific. Another Perl-ish way to write that expression might be: my @line = ( q{} ) x 3; I like to use named values for common strings and characters, like this: my $EMPTY = q{}; my @line = ( $EMPTY ) x 3; Just my humble opinion. -Jeff