in reply to CPAN namespace hierarchy

> Is there a way to browse the CPAN namespace hierarchy?

I'm not sure if I understand the requirement correctly.

Do you mean something like a foldable tree view which is interactively narrowed down while typing a query akin to a CSS selector?

> Maybe I'll just have to put a Tk wrapper around that data ...

If that's the requirement I'd try to feed a JSON hierarchy to one of those many *tree*.js libs in a browser while narrowing down with native "Xpath".

Just brainstorming if these are your requirements.

PS: I know at least one UI framework in JS offering a widget for narrowing down a tree.

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery

Replies are listed 'Best First'.
Re^2: CPAN namespace hierarchy
by GrandFather (Saint) on Jan 24, 2021 at 22:09 UTC

    The end goal is to figure out an appropriate XXX::YYY::ELF::Parser or XXX::YYY::Extract::ELF or some such module name for an ELF file parsing and data extraction module I'm putting together. The immediate driver for the project is to extract application images to be written to flash memory for an embedded system I'm working with at $work. That requires finding 60k of code out of a 6MB ELF file and dumping that into a suitable image to feed a boot loader. Given I haven't found anything useful on CPAN that works on Windows to do that I think it worth a slice of time to wrap the code I'm generating up for CPAN. The hierarchy stuff is just a means to figuring out what XXX, YYY and whatever else might be on that path might be.

    Optimising for fewest key strokes only makes sense transmitting to Pluto or beyond
      You've described your use case.

      That could easily be done by filtering the list of modules with a regular expression.

      But you mentioned TK, hence you have more requirements than just running some regex.

      Without knowing these requirements I can only guess.

      (I can't comment on ELF)

      For instance:

      RAT has a foldable thread/post view.

      You could translate those modules into such a tree.

      You could use JS / CSS selectors to interactively filter such a tree.

      But I don't think you'll invest in this. ;)

      If yes you could use the js-console to interactively try it out.

      HTH :)

      Cheers Rolf
      (addicted to the Perl Programming Language :)
      Wikisyntax for the Monastery

        In the end I found https://www.cpan.org/modules/02packages.details.txt.gz which contains a list of CPAN packages - about 250000 entries. I opened the contained text file in an editor and searched for ELF. Turns out there aren't many entries. Some sort of tree/folding representation wouldn't actually have helped very much as it turns out.

        Optimising for fewest key strokes only makes sense transmitting to Pluto or beyond