Bug#709082: libtest-perl-critic-perl: unconditionally exports functions

Russ Allbery rra at debian.org
Mon May 20 17:13:10 UTC 2013


Package: libtest-perl-critic-perl
Version: 1.02-1
Severity: normal

The import function of Test::Perl::Critic starts with:

sub import {

    my ( $self, %args ) = @_;
    my $caller = caller;

    {
        no strict 'refs';  ## no critic qw(ProhibitNoStrict)
        *{ $caller . '::critic_ok' }     = \&critic_ok;
        *{ $caller . '::all_critic_ok' } = \&all_critic_ok;
    }

which means that it doesn't use Exporter and doesn't provide any way
to not export those two functions into the caller's namespace.  This
makes it quite difficult to provide another module that wraps those
functions but provides the same interface (such as a module that calls
those functions with a specific local profile or perltidy configuration).

It's going to be a bit tricky to use Exporter because of the other
options supported by the import function, but it would be nice to at
least have an option saying not to import the functions into the caller's
namespace.

-- System Information:
Debian Release: jessie/sid
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable'), (1, 'experimental')
Architecture: i386 (i686)

Kernel: Linux 3.8-2-686-pae (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages libtest-perl-critic-perl depends on:
ii  libperl-critic-perl  1.118-1
ii  perl                 5.14.2-21

libtest-perl-critic-perl recommends no packages.

libtest-perl-critic-perl suggests no packages.

-- no debconf information



More information about the pkg-perl-maintainers mailing list