# from Ben Morrow
# on Thursday 02 October 2008:

>Being able to install latest.pm[1] and use an installed version
> doesn't help, though. If there's a bug in the section of latest.pm
> that tries to locate the installed copy of itself and use it instead,
> you *still* can't fix it. And since that is the entire functionality
> of latest.pm, there won't ever be any bugs you can fix by installing
> a fixed version.

That's not what latest.pm does.  The caller is expected to setup the 
@INC correctly for "use latest" -- *then* latest::import() figures out 
where the __THING YOU ACTUALLY WANT TO LOAD__ is.

Is that clear?  Or, you could just read the code:

  https://svn.perl.org/modules/Module-Build/trunk/inc/latest.pm

There is nothing in the latest.pm which prevents it *itself* from being 
superseded by an installed version (or even has anything to do with 
itself for that matter), but "latest.pm" being installed *is not* the 
design as it currently stands.

There *is* an issue with exactly what the author puts in their Build.PL, 
and I don't think that has been completely decided:

  1.  assume '.' is at the end of @INC:
    "use inc::latest 'Module::Build';"
    pro - overriding via installation now easy
          + only one line in Build.PL
    con - assumption might fail
    note: would require s/package latest/package inc::latest/

  2.  BEGIN {unshift(@INC, 'inc')} aka "use lib 'inc'"
    pro - no assumptions: you know what you're getting
    con - harder to override
    note: but not impossible

  3.  BEGIN {push(@INC, 'inc')}
    pro - no assumptions + easy to override
    con - not pronounced "use lib 'inc'"

And yes - #1 is what the Module::Install docs recommend.

>[1] IMHO it *really* ought to be called Module::Build::latest, as
>otherwise you're stomping on a top-level pragma namespace for the sake
>of a module that never gets installed.

If it *were* designed to be installed, then: yes.

But granted that:

  1. it only has meaning within a Build.PL and 
  2. we only need to override/install it on one really bad day

Thus, I'm more inclined to treat it as a much smaller time bomb and 
simply plan to issue special emergency crowbars after the fact.

--Eric
-- 
Moving pianos is dangerous.
Moving pianos are dangerous.
Buffalo buffalo buffalo buffalo buffalo buffalo buffalo.
---------------------------------------------------
    http://scratchcomputing.com
---------------------------------------------------

Reply via email to