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

People
Owner: thaljef [...] cpan.org
Requestors: david.pitt [...] nab.com.au
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in:
  • 0.13
  • 0.14
Fixed in: 0.15



Subject: 3rd arg to Violation->new() must be ARRAY ref ...
Perl-Critic-0.13 Perl-Critic-0.14 $ perlcritic <<EoT #!/usr/bin/perl #my %H1 = (A => [ 1 ], B => [ 2 ], C => []); my %H2 = ( A => [1], B => [2], C => [] ); EoT 3rd arg to Violation->new() must be ARRAY ref at /opt/perl/5.8.7/lib/site_perl/Perl/Critic/Policy/CodeLayout/RequireT railingCommas.pm line 34 Interestingly this is affected by whitespace, the same declaration on line 3 invokes the violation OK. $ perl -V Summary of my perl5 (revision 5 version 8 subversion 7) configuration: Platform: osname=solaris, osvers=2.8, archname=sun4-solaris-64 uname='sunos tdevs183 5.8 generic_117350-05 sun4u sparc sunw,netra- t12 ' config_args='-Duseshrplib -Duse64bitall -Dprefix=/opt/perl/5.8.7 - Dscriptdir=/opt/perl/5.8.7/bin - Dinstallprefix=/tmp/kalm/build_perl/5.8.7/core/dist//opt/perl/5.8.7 - Darchlib=/opt/perl/5.8.7/lib/sun4-solaris-64 - Dprivlib=/opt/perl/5.8.7/lib - Dsitearch=/opt/perl/5.8.7/lib/site_perl/sun4-solaris-64 - Dsitelib=/opt/perl/5.8.7/lib/site_perl -Dlocincpth=/opt/local/include - Dloclibpth=/opt/local/lib -Dperl5=/opt/perl/5.8.7/bin/perl -des' hint=recommended, useposix=true, d_sigaction=define usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef useperlio=define d_sfio=undef uselargefiles=define usesocks=undef use64bitint=define use64bitall=define uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='cc', ccflags ='-xarch=v9 -I/opt/local/include - D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64', optimize='-O', cppflags='-xarch=v9 -I/opt/local/include' ccversion='Sun C 5.5 Patch 112760-15 2004/11/10', gccversion='', gccosandvers='' intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=87654321 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16 ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8 alignbytes=8, prototype=define Linker and Libraries: ld='cc', ldflags =' -xarch=v9 -L/usr/lib/sparcv9 - L/usr/ccs/lib/sparcv9 -L/opt/studio8/SUNWspro/prod/lib/v9 - L/opt/local/lib ' libpth=/usr/lib/sparcv9 /usr/ccs/lib/sparcv9 /opt/studio8/SUNWspro/prod /lib/v9 /opt/local/lib /usr/lib /usr/ccs/lib /usr/local/lib libs=-lsocket -lnsl -ldl -lm -lc perllibs=-lsocket -lnsl -ldl -lm -lc libc=/usr/lib/sparcv9/libc.so, so=so, useshrplib=true, libperl=libperl.so gnulibc_version='' Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' - R /opt/perl/5.8.7/lib/sun4-solaris-64/CORE' cccdlflags='-KPIC', lddlflags=' -G -xarch=v9 -L/usr/lib/sparcv9 - L/usr/ccs/lib/sparcv9 -L/opt/studio8/SUNWspro/prod/lib/v9 - L/opt/local/lib' Characteristics of this binary (from libperl): Compile-time options: USE_64_BIT_INT USE_64_BIT_ALL USE_LARGE_FILES Built under solaris Compiled at Dec 16 2005 15:56:37 %ENV: PERL5LIB="/opt/kalmd/lib:/home/dpitt/myperl/lib/site_perl:/home/dpitt/m yperl/lib" @INC: /opt/kalmd/lib /home/dpitt/myperl/lib/site_perl/5.8.7/sun4-solaris-64 /home/dpitt/myperl/lib/site_perl/5.8.7 /home/dpitt/myperl/lib/site_perl /home/dpitt/myperl/lib/sun4-solaris-64 /home/dpitt/myperl/lib /opt/perl/5.8.7/lib/sun4-solaris-64 /opt/perl/5.8.7/lib /opt/perl/5.8.7/lib/site_perl/sun4-solaris-64 /opt/perl/5.8.7/lib/site_perl /opt/perl/5.8.7/lib/site_perl . $ uname -a SunOS tdevs183 5.8 Generic_117350-28 sun4u sparc SUNW,Netra-T12
I have not been able to reproduce this bug. The Violation class is definitely not compatible between versions 0.13 and versions 0.14. Is it possible that you have combined the distributions somehow? The one-line example passes because the RequireTrailingComma policy only applies to list declarations that are multi-line. -Jeff On Mon Feb 20 20:29:52 2006, guest wrote: Show quoted text
> Perl-Critic-0.13 > Perl-Critic-0.14 > > $ perlcritic <<EoT > #!/usr/bin/perl > > #my %H1 = (A => [ 1 ], B => [ 2 ], C => []); > my %H2 = ( > A => [1], > B => [2], > C => [] > ); > EoT > 3rd arg to Violation->new() must be ARRAY ref >
at /opt/perl/5.8.7/lib/site_perl/Perl/Critic/Policy/CodeLayout/RequireT Show quoted text
> railingCommas.pm line 34 > > Interestingly this is affected by whitespace, the same declaration
on Show quoted text
> line 3 invokes the violation OK.
CC: jeffrey_thalhammer [...] yahoo.com
Subject: Re: [rt.cpan.org #17776] 3rd arg to Violation->new() must be ARRAY ref ...
Date: Mon, 27 Feb 2006 09:31:37 +1100
To: bug-Perl-Critic [...] rt.cpan.org
From: David.Pitt [...] nab.com.au
Hi Jeffrey, The bug occurs under our clean Perl 5.8.7/Perl-Critic 0.13 install, and also under a dirty 5.6.1/0.14 install. I'll try it again when we upgrade the clean environment to P::C 0.14, in the meantime don't worry about it. Haven't had a response from Corporate Affairs about your case study, will ping them this week. Regards, David Pitt | Basel II Technology | National Australia Bank Limited Phone +61 3 8641 2014 | Email david.pitt@nab.com.au | Level 6, 500 Bourke Street, Melbourne "Jeffrey Thalhammer via RT" To <bug-Perl-Critic@ david.pitt@nab.com.au rt.cpan.org> cc 27/02/2006 09:03 Subject AM [rt.cpan.org #17776] 3rd arg to Violation->new() must be ARRAY ref ... Please respond to bug-Perl-Critic@r t.cpan.org I have not been able to reproduce this bug. The Violation class is definitely not compatible between versions 0.13 and versions 0.14. Is it possible that you have combined the distributions somehow? The one-line example passes because the RequireTrailingComma policy only applies to list declarations that are multi-line. -Jeff On Mon Feb 20 20:29:52 2006, guest wrote: Show quoted text
> Perl-Critic-0.13 > Perl-Critic-0.14 > > $ perlcritic <<EoT > #!/usr/bin/perl > > #my %H1 = (A => [ 1 ], B => [ 2 ], C => []); > my %H2 = ( > A => [1], > B => [2], > C => [] > ); > EoT > 3rd arg to Violation->new() must be ARRAY ref >
at /opt/perl/5.8.7/lib/site_perl/Perl/Critic/Policy/CodeLayout/RequireT Show quoted text
> railingCommas.pm line 34 > > Interestingly this is affected by whitespace, the same declaration
on Show quoted text
> line 3 invokes the violation OK.
National Australia Bank Limited - ACN 004 044 937 This email may contain confidential information. If you are not the intended recipient, please immediately notify us at postmaster@nab.com.au or by replying to the sender, and then destroy all copies of this email. Except where this email indicates otherwise, views expressed in this email are those of the sender and not of National Australia Bank Limited. Advice in this email does not take account of your objectives, financial situation, or needs. It is important for you to consider these matters and, if the e-mail refers to a product(s), you should read the relevant Product Disclosure Statement(s)/other disclosure document(s) before making any decisions. If you do not want email marketing from us in future, forward this email with "unsubscribe" in the subject line to Unsubscribe@nab.com.au in order to stop marketing emails from this sender. National Australia Bank Limited does not represent that this email is free of errors, viruses or interference
I'm almost certain this is caused by the incompatibilities between version 0.13 and later versions. The easiest solution is to delete the Perl/Critic/Policy directory in your installation and reinstall. Beware if you have installed any custom Policy modules in that directory. -Jeff On Mon Feb 20 20:29:52 2006, guest wrote: Show quoted text
> Perl-Critic-0.13 > Perl-Critic-0.14 > > $ perlcritic <<EoT > #!/usr/bin/perl > > #my %H1 = (A => [ 1 ], B => [ 2 ], C => []); > my %H2 = ( > A => [1], > B => [2], > C => [] > ); > EoT > 3rd arg to Violation->new() must be ARRAY ref >
at /opt/perl/5.8.7/lib/site_perl/Perl/Critic/Policy/CodeLayout/RequireT Show quoted text
> railingCommas.pm line 34 > > Interestingly this is affected by whitespace, the same declaration
on Show quoted text
> line 3 invokes the violation OK. > > $ perl -V > Summary of my perl5 (revision 5 version 8 subversion 7)
configuration: Show quoted text
> Platform: > osname=solaris, osvers=2.8, archname=sun4-solaris-64 > uname='sunos tdevs183 5.8 generic_117350-05 sun4u sparc
sunw,netra- Show quoted text
> t12 ' > config_args='-Duseshrplib -Duse64bitall -
Dprefix=/opt/perl/5.8.7 - Show quoted text
> Dscriptdir=/opt/perl/5.8.7/bin - > Dinstallprefix=/tmp/kalm/build_perl/5.8.7/core/dist//opt/perl/5.8.7 - > Darchlib=/opt/perl/5.8.7/lib/sun4-solaris-64 - > Dprivlib=/opt/perl/5.8.7/lib - > Dsitearch=/opt/perl/5.8.7/lib/site_perl/sun4-solaris-64 - > Dsitelib=/opt/perl/5.8.7/lib/site_perl -
Dlocincpth=/opt/local/include - Show quoted text
> Dloclibpth=/opt/local/lib -Dperl5=/opt/perl/5.8.7/bin/perl -des' > hint=recommended, useposix=true, d_sigaction=define > usethreads=undef use5005threads=undef useithreads=undef > usemultiplicity=undef > useperlio=define d_sfio=undef uselargefiles=define usesocks=undef > use64bitint=define use64bitall=define uselongdouble=undef > usemymalloc=n, bincompat5005=undef > Compiler: > cc='cc', ccflags ='-xarch=v9 -I/opt/local/include - > D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64', > optimize='-O', > cppflags='-xarch=v9 -I/opt/local/include' > ccversion='Sun C 5.5 Patch 112760-15 2004/11/10', gccversion='', > gccosandvers='' > intsize=4, longsize=8, ptrsize=8, doublesize=8,
byteorder=87654321 Show quoted text
> d_longlong=define, longlongsize=8, d_longdbl=define,
longdblsize=16 Show quoted text
> ivtype='long', ivsize=8, nvtype='double', nvsize=8,
Off_t='off_t', Show quoted text
> lseeksize=8 > alignbytes=8, prototype=define > Linker and Libraries: > ld='cc', ldflags =' -xarch=v9 -L/usr/lib/sparcv9 - > L/usr/ccs/lib/sparcv9 -L/opt/studio8/SUNWspro/prod/lib/v9 - > L/opt/local/lib ' > >
libpth=/usr/lib/sparcv9 /usr/ccs/lib/sparcv9 /opt/studio8/SUNWspro/prod Show quoted text
> /lib/v9 /opt/local/lib /usr/lib /usr/ccs/lib /usr/local/lib > libs=-lsocket -lnsl -ldl -lm -lc > perllibs=-lsocket -lnsl -ldl -lm -lc > libc=/usr/lib/sparcv9/libc.so, so=so, useshrplib=true, > libperl=libperl.so > gnulibc_version='' > Dynamic Linking: > dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' - > R /opt/perl/5.8.7/lib/sun4-solaris-64/CORE' > cccdlflags='-KPIC', lddlflags=' -G -xarch=v9 -L/usr/lib/sparcv9 - > L/usr/ccs/lib/sparcv9 -L/opt/studio8/SUNWspro/prod/lib/v9 - > L/opt/local/lib' > > > Characteristics of this binary (from libperl): > Compile-time options: USE_64_BIT_INT USE_64_BIT_ALL USE_LARGE_FILES > Built under solaris > Compiled at Dec 16 2005 15:56:37 > %ENV: > >
PERL5LIB="/opt/kalmd/lib:/home/dpitt/myperl/lib/site_perl:/home/dpitt/m Show quoted text
> yperl/lib" > @INC: > /opt/kalmd/lib > /home/dpitt/myperl/lib/site_perl/5.8.7/sun4-solaris-64 > /home/dpitt/myperl/lib/site_perl/5.8.7 > /home/dpitt/myperl/lib/site_perl > /home/dpitt/myperl/lib/sun4-solaris-64 > /home/dpitt/myperl/lib > /opt/perl/5.8.7/lib/sun4-solaris-64 > /opt/perl/5.8.7/lib > /opt/perl/5.8.7/lib/site_perl/sun4-solaris-64 > /opt/perl/5.8.7/lib/site_perl > /opt/perl/5.8.7/lib/site_perl > . > > $ uname -a > SunOS tdevs183 5.8 Generic_117350-28 sun4u sparc SUNW,Netra-T12