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

Re: Should we bring in Module::Runtime into core?

Thread Previous | Thread Next
From:
Leon Timmermans
Date:
December 5, 2016 18:01
Subject:
Re: Should we bring in Module::Runtime into core?
Message ID:
CAHhgV8g4mERUMareiH30bU-T3RSrw=PJVbth4rvcyuT_UP=A7g@mail.gmail.com
On Sun, Dec 4, 2016 at 11:15 PM, Ricardo Signes <perl.p5p@rjbs.manxome.org>
wrote:

> * Sawyer X <xsawyerx@gmail.com> [2016-12-04T11:55:02]
> > It has been suggested several times to ship Module::Runtime in core. I
> > have considered it and discussed it with Zefram a little bit yesterday.
>
> Can we get a brief rundown of why Module::Runtime is superior to
> Module::Load,
> which is already core?  I've heard it said that it is, and I have no
> reason to
> doubt it, but I don't know the reasons.


Module::Load's interface is rather more heuristic than desirable. If your
input doesn't look like it could be a module (/[^\w:'/), it will require it
as a filename, if not it will try to convert it to a filename, first trying
with ".pm" appended and then without (resulting in a rather characteristic
double error). In the latter case if given arguments (or called as
autoload) it will also run the associated import method.

These are many different behaviors, that should really have  different
names (e.g. load_file and load_module), and TBH some of those behaviors
probably shouldn't exist. Module::Load is the sort of tool that will
usually work, but can sometimes magically do something confusing.

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