On Wed, Aug 1, 2012 at 4:45 PM, Nicholas Clark <nick@ccl4.org> wrote:
> That's the one I disagreed on, as stated previously. Other parts of the
> language treat ::foo and ::::foo differently:
For this purpose, I don't think it matters. My view is that the
"magical" conversion of barewords to file paths should not result in
absolute paths. They are different namespaces, yes, but they map to
the same path[1], so the behavior for *require* can be the same. ([1]
Yes, I'm handwaving that "/foo" and "//foo" aren't really the same,
but they have the same effect on typical Unix OSes)
> Doing what you suggest and treating them the same here increases the
> inconsistency in the language. No-one has specifically explained why I
> am wrong on this.
In my opinion, it increases the consistency of the behavior of
require. Docs say this:
If EXPR is a bareword, the require assumes a ".pm" extension and
replaces "::" with "/"
in the filename for you, to make it easy to load standard modules.
Thus, making ::tmp become a relative "tmp" path and ::::tmp become an
absolute "/tmp" path, means a special case for one versus more than
one leading "::". I think it's more consistent (and easier to
explain) to say that any number of leading "::" in require are just
illegal.
-- David
Thread Previous
|
Thread Next