Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: r10662 - "import" is not exported by the Exporter module

0 views
Skip to first unread message

Eric Wilhelm

unread,
Feb 17, 2008, 12:51:56 AM2/17/08
to module...@perl.org
# from kwil...@cvs.perl.org
# on Monday 28 January 2008 15:21:

>Trade a bad idiom for a good one
>
>Modified: Module-Build/trunk/t/lib/DistGen.pm
>======================================================================
>======== --- Module-Build/trunk/t/lib/DistGen.pm (original)
>+++ Module-Build/trunk/t/lib/DistGen.pm Mon Jan 28 15:21:37 2008
>@@ -27,8 +27,7 @@
>     }
> }
> BEGIN {
>-  require Exporter;
>-  *{import} = \&Exporter::import;
>+  use Exporter 'import';

Looks like we need to roll this back to be compatible with 5.6.2. Are
we trying to be compatible with 5.6.2?

--Eric
--
"Matter will be damaged in direct proportion to its value."
--Murphy's Constant
---------------------------------------------------
http://scratchcomputing.com
---------------------------------------------------

Ken Williams

unread,
Feb 17, 2008, 1:05:13 AM2/17/08
to Eric Wilhelm, module...@perl.org
On Feb 16, 2008 11:51 PM, Eric Wilhelm <scratchc...@gmail.com> wrote:
> Looks like we need to roll this back to be compatible with 5.6.2. Are
> we trying to be compatible with 5.6.2?

Yeah, I guess we are. Thanks for the spot.

-Ken

Adriano Ferreira

unread,
Feb 17, 2008, 7:30:06 AM2/17/08
to module...@perl.org
According to Exporter latest docs
(http://search.cpan.org/~ferreira/Exporter-5.62c/lib/Exporter.pm#Exporting_without_inheriting_from_Exporter),

use Exporter 'import';

has been introduced in version 5.57 of Exporter, released with perl
5.8.3. Thus,

BEGIN {
require Exporter;


*{import} = \&Exporter::import;
}

would be justifiable if M::B does not intend to force an Exporter
upgrade (since it has dual life now). From the list of changes of
lib/Exporter.pm, including:

(from http://public.activestate.com/cgi-bin/perlbrowse/l/lib/Exporter.pm)

21798 on 2003/11/28 by rgs@rgs-home

Implement C<use Exporter 'import'> :

Subject: Re: [PATCH] Exporter-related PODs
From: Fergal Daly <***@esatclear.ie>
Date: Mon, 10 Nov 2003 00:08:52 +0000
Message-Id: <200311100008...@esatclear.ie>

(tweaked, so the imported import() doesn't spit out warnings)

it seems that the ugly idiom should (hopefully) work alright for older
Exporter's.

Regards,
Adriano Ferreira

0 new messages