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

Should I upload it on CPAN?

by llancet (Friar)
on Feb 20, 2012 at 02:33 UTC ( [id://954960]=perlquestion: print w/replies, xml ) Need Help??

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

I'm planning to make these two things:

A: a software, main part of which is a script, not a perl module.
B: a software, and its modules can also be used separately.

I think B is suitable for CPAN, and what about A?

Replies are listed 'Best First'.
Re: Should I upload it on CPAN?
by JavaFan (Canon) on Feb 20, 2012 at 15:07 UTC
    CPAN is full of modules, but sparse on programs/scripts/utilities. CPAN is like a Home Depot, full of construction material, and not much plug-and-play.

    I'd say please do option A. That's what CPAN needs, more than it does B.

Re: Should I upload it on CPAN?
by Anonymous Monk on Feb 20, 2012 at 02:41 UTC
      There's nothing wrong with asking if something might be of value to others before submitting to CPAN. Some people treat CPAN as merely a code repository, giving no thought to the value to others, as can be seen in poor API design, lack of documentation, poor distribution name, etc. Those people should instead upload to github or bitbucket. The best CPAN authors are those who take some time to think through the decision process.

        There's nothing wrong with asking if something might be of value to others before submitting to CPAN.

        And there is nothing wrong with NOT asking.

        The OPs specific question was about file-layout, not about what the software does.

      I developed them using eclipse, Module::Starter, and Module::Build. So I'll surely create a package in the style CPAN likes.
Re: Should I upload it on CPAN?
by repellent (Priest) on Feb 20, 2012 at 21:33 UTC
    Ship both! And thanks for contributing.

    I've seen option A namespaced under App::*. What comes to mind are App::Ack, and App::cpanminus.
Re: Should I upload it on CPAN?
by tobyink (Canon) on Feb 22, 2012 at 23:23 UTC

    The trick with publishing non-modular software to CPAN, is to pull out as much code as possible into modules, and narrow the "script" part of it down to a few lines.

    As an example... I developed a script called reprove as a result of a discussion in this monastery. I got the script itself down to just two lines of code. The bulk of the code is in Module::Reprove, while App::Reprove handles command-line processing, output to the terminal, etc.

      I got the script itself down to just two lines of code. The bulk of the code is in Module::Reprove, while App::Reprove handles command-line processing, output to the terminal, etc.

      Are either of those two modules useful for anything standalone?

      If, as I suspect, the answer is no, then what the &%&^%&^ is the point of making them separate modules?

      And what is the point of a 3 line script?

      It's like saying you've built a personal flying machine that only weights 20 kgs. You just put it on and board any jet that going where you want to go.

      It's this kind of pseud-OO bullshit that makes CPAN a pain to use.


      With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.

      The start of some sanity?

        And what is the point of a 3 line script?

        I used to think that too, but I've moved more and more of my programs into modules and used wrapper scripts to invoke them with the most common arguments already defined. It's improved the testability and usability of a lot of my code. Otherwise I ended up with a lot of shell aliases to invoke modules—and there's not much documentation there.

        Module::Reprove certainly is. App::Reprove probably less so. But a good reason to modularise code is to make it extendable using the well-understood mechanism of inheritance.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://954960]
Approved by planetscape
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (3)
As of 2024-04-19 17:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found