in reply to Re: Upgrading core modules
in thread Upgrading core modules

How can one tell if a core module is purely core or dual-life?

I don't want to do it, I'm just wondering how to handle it in a custom cpan client.

Replies are listed 'Best First'.
Re^3: Upgrading core modules
by hippo (Archbishop) on Feb 09, 2023 at 22:24 UTC

    If you search on CPAN and find a module which also has its own distribution as well as being in the "perl" distribution then that is dual-life. There's also a handy list on github.

    If you are writing a custom CPAN client then I would suggest you simply ignore this. Dual-life modules should be treated by the client just the same as anything else on CPAN. Purely core modules shouldn't be updated by the client. Simple.


    🦛

      There's also a handy list on github.

      That list looks incomplete to me - there are many more dual-life modules than are listed there.

      Another thing one can do is to check the perl source. One will see there's a top level folder named "cpan".
      Updating any module that's included in that folder is worth trying, and will generally (but perhaps not always) be successful.
      Some, if not all, of those modules make a point of retaining backwards-compatibility.

      The only other core modules that provide a standalone source that could be at a more recent version, are the ones in the top level "devel" "dist" folder.
      These are also worth trying, though the version they provide is often no more recent than what one's perl already contains. Of course that depends upon just how out of date your perl is.

      AFAIK, any other core perl modules will not exist as standalone source and should be left alone.
      There have been times when I've tried to create a standalone source from the perl source. It has often become a messy exercise, and one that has never been fruitful.
      I don't recommend it. Of course, one is allowed to attempt it - and it might even work out ok.

      Oh .... I should point out that some of those core modules might be relocated over time.
      For example, Math::Complex was in "cpan" when perl-5.36.0 was released but has now been moved to "devel" "dist", and will be in the "devel" "dist" folder when 5.38.0 source is released.

      Cheers,
      Rob
        The only other core modules that provide a standalone source that could be at a more recent version, are the ones in the top level "devel" folder.

        Thanks for your informative reply. I could not find a top level "devel" folder. Digging around I'm pretty sure you meant the "dist" folder.

Re^3: Upgrading core modules
by kcott (Archbishop) on Feb 10, 2023 at 17:19 UTC
    "How can one tell if a core module is purely core or dual-life?"

    Take a look at a post of mine from last week which discusses this. It has other information, and does not use the term "dual-life". See the two sections which start with:

    • "Modules which are core, but do not have a separate CPAN version, ..." [i.e. purely core]
    • "Modules which are core, but also have a separate CPAN version, ..." [i.e. dual-life]

    — Ken