Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

CPAN namespace hierarchy

by GrandFather (Saint)
on Jan 24, 2021 at 21:29 UTC ( #11127406=perlquestion: print w/replies, xml ) Need Help??

GrandFather has asked for the wisdom of the Perl Monks concerning the following question:

Is there a way to browse the CPAN namespace hierarchy? I'm trying to figure out the best place to fit a new module for parsing and dumping selected contents of ELF files. I've scanned through the PAUSE docs that looked most likely to lead the way, but didn't see anything.

Hmm, while preparing this question I found https://www.cpan.org/modules/01modules.index.html which is at least part of the answer, but somewhat unwieldy. Maybe I'll just have to put a Tk wrapper around that data unless someone has a suitably lazier option for me?

Update: https://ELF::Extract::Sections exists already and has a name rather like what I would want to use. However it's dependency heavy and has a pretty bad rep on cpantesters, especially for Windows builds. I did try installing ELF::Extract::Sections, but after a rather long time it failed as might have been guessed from the testers reports. I'm open to suggestions for an alternate name in the vicinity of the ELF::Extract name space.

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

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

    After a bunch of digging around on CPAN my thoughts are converging toward ELF::Reader. There is ELF::Writer already and my proposed module is pretty close to a complement to the writer module. My inclination is migrate my interface toward Writer's interface where that makes sense. Comments?

    Optimising for fewest key strokes only makes sense transmitting to Pluto or beyond
      there is also a script "elf.pl" for similar use in Convert::Binary::C, take a look?




      I am trying to improve my English skills, if you see a mistake please feel free to reply or /msg me a correction

        From what I infer from the very light documentation for elf.pl the script may be able to dump structural information, but it doesn't look like it will let me extract data for selected segments. My ultimate goal is to be able to generate update images for a boot loader on an embedded system. The module is just a means to that end. Since I'm writing the code anyway it seemed worth turning it into a CPAN appropriate module.

        Optimising for fewest key strokes only makes sense transmitting to Pluto or beyond
Re: CPAN namespace hierarchy
by LanX (Cardinal) on Jan 24, 2021 at 21:59 UTC
    > 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

      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

Re: CPAN namespace hierarchy
by Discipulus (Abbot) on Jan 24, 2021 at 23:14 UTC
    Hello GrandFather,

    did you missed my masterpiece of hubris? ;)

    L*

    There are no rules, there are no thumbs..
    Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.
Re: CPAN namespace hierarchy
by 1nickt (Abbot) on Jan 24, 2021 at 21:53 UTC

    Hello Grandfather, I remember finding Map of CPAN interesting when I stumbled on it; it shows the top-level spaces but is definitely not a hierarchally ordered rendering!

    Hope this helps!

    The way forward always starts with a minimal test.

      Yes, ++choroba mentioned it in the CB. It's pretty, but it's not really what I'm looking for.

      Optimising for fewest key strokes only makes sense transmitting to Pluto or beyond
Re: CPAN namespace hierarchy
by betmatt (Scribe) on Jan 24, 2021 at 22:59 UTC
    Salve,

    I've recently played around with Postgresql and I was surprised to see that it offers class hierarchies for Subjects of the SELECT statements. I don't know about SQLite. I doubt that this offers the same. I really don't know whether this answer is helpful. Some sort of Postgresql emulator might exist? Or maybe a Postgresql cloud solution. I feel that this post is not likely to be helpful, but I write it on the off chance that it is.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://11127406]
Front-paged by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (4)
As of 2021-03-04 00:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My favorite kind of desktop background is:











    Results (97 votes). Check out past polls.

    Notices?