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

People
Owner: thaljef [...] cpan.org
Requestors: thaljef [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.08_02
Fixed in: (no value)



Subject: ProhibitParensWithBuiltins dies when bare "undef" is encountered
Just playing with Perl::Critic and noticed a few conditions which cause the code to barf: #!/usr/bin/perl -w use strict; use warnings; my %params = (); my $config_ref = { _page_count => ( exists $params{page_count} ? $params{page_count} : undef ), _size => $params{size} || undef }; Both the "undef )" on the _page_count line and the trailing undef on the _size line cause the module to barf with the error Can't call method "isa" without a package or object reference at xxx/ProhibitParensWithBuiltins.pm line 22. This is because $sib is empty in both cases. I appreciate that the code isn't guideline-compliant, but it shouldn't just die ;-) I have tweaked the code and it now works OK. Adding a trailing comma to the second one works (by making $sib a comma) but using a constant var $UNDEF works for both.