Skip Menu | will be shut down on March 1st, 2021.

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

Owner: Nobody in particular
Requestors: EDAVIS [...]

Bug Information
Severity: Wishlist
Broken in: 1.117
Fixed in: (no value)

Subject: Suggested policy: if string constant exists, check it is used consistently
Download (untitled) / with headers
text/plain 651b
Often you abstract out a commonly-occuring string into a constant. For example my $maintainer = ''; ... die "unexpected error - please contact $maintainer"; But you may forget about that constant and use the string directly in some cases: my $maintainer = ''; ... die "unexpected error - please contact $maintainer"; ... warn 'strange condition - report to'; It would be useful to have a policy which, on seeing a string variable defined in the code with a compile-time string, warns about occurrences of that string later on in the code, in places where the variable is in scope.

This service is sponsored and maintained by Best Practical Solutions and runs on infrastructure.

Please report any issues with to