develooper Front page | perl.perl5.porters | Postings from October 2011

Re: [perl #101976] [PATCH] Remove cruft from the module example

Thread Previous | Thread Next
From:
Leon Timmermans
Date:
October 23, 2011 13:05
Subject:
Re: [perl #101976] [PATCH] Remove cruft from the module example
Message ID:
CAHhgV8h1jV5v3htq4RrXoO9LJWZKXUpxYbU23Mv5+_cwDY4+NQ@mail.gmail.com
On Sun, Oct 23, 2011 at 9:50 PM, Father Chrysostomos via RT
<perlbug-followup@perl.org> wrote:
> The problem with that is the lack of introspection.  With inheritance,
> one can say Class->isa("Exporter") and, if it returns true, read
> @EXPORT* and %EXPORT_TAGS to find out what is exported.
>
> Without ->isa("Exporter"), there’s no guarantee that what is in those
> variables has anything to do with Exporter.

Relying on such an implementation detail is broken anyway. It we
wanted that to work we should have never allowed «use Exporter
'import'». That ship has sailed a long time ago, for very good
reasons. Besides, if you really want it you can check if
$package->can('import') is really Exporter::import or some such.

Leon

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About