develooper Front page | perl.perl5.porters | Postings from December 2015

Re: Proposal: Add {-as => 'new_name'} feature to

Thread Previous | Thread Next
Eirik Berg Hanssen
December 20, 2015 23:51
Re: Proposal: Add {-as => 'new_name'} feature to
Message ID:
On Sun, Dec 20, 2015 at 11:07 PM, Zefram <> wrote:

> demerphq wrote:
> >                                                              How is
> >such a facility any different from what the OP wants to add to
> >Exporter?
> It differs in being on the importing side.  It would be invoked by the
> module that wants the renaming, and not depend on cooperation from the
> exporting side.

  Only for sufficiently compliant exports, I suspect.

  My Test::Trap exports a new scalar and associated function on every call
to import().  Whenever the function is called, it assigns a new object to
the exported scalar through the symbol table.  You could alias the function
without breaking anything, but how would you alias the scalar, so that the
alias is also updated whenever the exported scalar is?  (Particularly
interesting when the symbol table in question is deleted, I imagine.)

  How many other exporter strategies out there would this fail to account
for, I wonder?


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