Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: scripts on CPAN

by rinceWind (Monsignor)
on Mar 23, 2007 at 18:30 UTC ( [id://606322]=note: print w/replies, xml ) Need Help??


in reply to scripts on CPAN

As you have implied in your first sentence, CPAN is all about distributions. There's more to a distribution than shipping code that the user can run. There's documentation, tests, examples, and control files that help you verify that your distribution is complete. A standalone script wouldn't have all, or indeed any of this provided.

The traditional way of distributing a script is as a standalone file that needs to be copied into a special place, e.g. a cgi-bin directory. There may be some manual configuring required with an editor, to set variables to contain real paths on the target machine. As a potential user, putting the script live is a great leap of faith. There's no reassurance that it will work with the configuration of the machine on which it's being installed.

A much better idea is to put all your functionality into one or more .pm files, and ship a bare bones script that calls the module(s). The reason why it's better is that you can write tests that call the module API and exercise the code completely.

The installer of your distribution gets to run tests of the module's functionality during the installation process, and is instantly made aware of any problems, before the module is installed. This becomes even more important when it comes to upgrading an existing installation.

--
Apprentice wetware hacker

Replies are listed 'Best First'.
Re^2: scripts on CPAN
by GrandFather (Saint) on Mar 23, 2007 at 21:51 UTC

    That makes a large amount of sense to me. I've been quietly grumbling for a long time that the scripts area on CPAN is very much a second class citizen - now I understand why.

    Indeed, exactly those considerations are why a next version of PMEdit will go up as a module distribution rather than to the scripts area, so I guess in a rather arse backwards fashion the objectives of CPAN are being imposed and met. ;)

    Thanks for the clarification. It would be nice if something like your explanation were promanent in the scripts area of CPAN.


    DWIM is Perl's answer to Gödel

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (5)
As of 2024-03-29 13:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found