Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

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

Report information
The Basics
Id: 29555
Status: rejected
Priority: 0/
Queue: Test-Perl-Critic

People
Owner: Nobody in particular
Requestors: dmuey [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: 1.01
Fixed in: (no value)



Subject: hashref treated as object = randomly and incorrectly failing
http://cpantesters.perl.org/show/Data-Rand.html Two strange issues: 1) the same version of Test::Perl::Critic (1.01) give different results, some pass, some fail 2) The failures are this: Private Member Data shouldn't be accessed directly. at line XX, column XX. Accessing an objects data directly breaks encapsulation and should be avoided. Example: $object-> { some_key }. (Severity: 5) Trouble is this is not an OO based module, the errors are in reference to a hashref like so: $options_hr->{'details'}
On Sat Sep 22 15:55:25 2007, DMUEY wrote: Show quoted text
> http://cpantesters.perl.org/show/Data-Rand.html > > Two strange issues: > 1) the same version of Test::Perl::Critic (1.01) give different > results, some pass, some fail > 2) The failures are this: > > Private Member Data shouldn't be accessed directly. at line XX, column > XX. Accessing an > objects data directly breaks encapsulation and should be avoided. > Example: $object-> > { some_key }. (Severity: 5) > > Trouble is this is not an OO based module, the errors are in reference > to a hashref like so: > > $options_hr->{'details'}
I grepped for that error message in the Perl::Critic source tree and I can't find it anywhere. Is it possible that you have a third-party Perl::Critic policy installed that is causing that error? If that doesn't ring a bell, try setting the -verbose argument to perlcritic to include %p to show the name of the policy that triggered the violation. -- Chris
This smells like it might becoming from Kent Cowgill's module: ValuesAndExpressions::ProhibitAccessOfPrivateData. You might want to take this bug report over there.