Subject: | '"import" is not exported by the Exporter module' error when running perlcritic on Perl 5.8.1 |
Date: | Fri, 6 Jul 2007 13:40:48 +1000 |
To: | <bug-Perl-Critic [...] rt.cpan.org> |
From: | "David Gregory" <David.Gregory [...] intecbilling.com> |
Perl::Critic Version = 1.06
Perl Version = 64 bit 5.8.1 for HP-UX 11.23 on Itanium
perl -V Output =
Summary of my perl5 (revision 5.0 version 8 subversion 1) configuration:
Platform:
osname=hpux, osvers=11.22, archname=IA64.ARCHREV_0-LP64
uname -a Output:
HP-UX <host> B.11.23 U ia64 2102037814 unlimited-user license
I get the following error when running perlcritic after upgrading from 0.17 to 1.06
"import" is not exported by the Exporter module
Can't continue after import errors at /opt/perl/lib/site_perl/5.8.1/Perl/Critic/Theme.pm line 15
BEGIN failed--compilation aborted at /opt/perl/lib/site_perl/5.8.1/Perl/Critic/Theme.pm line 15.
Compilation failed in require at /opt/perl/lib/site_perl/5.8.1/Perl/Critic/Config.pm line 20.
BEGIN failed--compilation aborted at /opt/perl/lib/site_perl/5.8.1/Perl/Critic/Config.pm line 20.
Compilation failed in require at /opt/perl/lib/site_perl/5.8.1/Perl/Critic.pm line 18.
BEGIN failed--compilation aborted at /opt/perl/lib/site_perl/5.8.1/Perl/Critic.pm line 18.
Compilation failed in require at /opt/perl/bin/perlcritic line 190.
It appears as though the new Theme system introduced around version 1.0 assumes the use of the latest Exporter which allows the 'use Exporter qw{ import }' construct. Older Exporter versions do not allow this.
I have worked around this by changing Perl::Critic::Theme to use the older method of using Exporter.
#use Exporter qw{ import };
require Exporter;
our @ISA = qw(Exporter);
This e-mail and any attachments are confidential and may also be legally privileged and/or copyright material of Intec Telecom Systems PLC (or its affiliated companies). If you are not an intended or authorised recipient of this e-mail or have received it in error, please delete it immediately and notify the sender by e-mail. In such a case, reading, reproducing, printing or further dissemination of this e-mail or its contents is strictly prohibited and may be unlawful. Intec Telecom Systems PLC does not represent or warrant that an attachment hereto is free from computer viruses or other defects. The opinions expressed in this e-mail and any attachments may be those of the author and are not necessarily those of Intec Telecom Systems PLC.