develooper Front page | perl.perl5.porters | Postings from March 2007

Re: Exporter Warning Mystery

Thread Previous | Thread Next
Nicholas Clark
March 9, 2007 10:06
Re: Exporter Warning Mystery
Message ID:
On Fri, Mar 09, 2007 at 06:58:36PM +0100, Rafael Garcia-Suarez wrote:
> On 09/03/07, Nicholas Clark <> wrote:
> >Why does it warn if it's reading its libraries from the build tree, but not
> >when they're installed?
> Feature !
> See in gv.c :
>                /* performance hack: if filename is absolute and it's a 
>                standard
>                 * module, don't bother warning */

Yes, I just remembered that I'd read that comment (while watering my plants)
and wondered it if was it.

This part of Exporter.t is currently bogus:

my $warnings;
    $SIG{__WARN__} = sub { $warnings = join '', @_ };
    package Testing::Unused::Vars;
    @ISA = qw(Exporter);
    @EXPORT = qw(this $TODO that);

    package Foo;

::ok( !$warnings, 'Unused variables can be exported without warning' ) ||
  print "# $warnings\n";

(because the test C<require>s Exporter, rather than C<use>ing it)

Should we fix Exporter not to warn? Rather than relying on "performance hack"
to keep it quiet?

Nicholas Clark

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About