Beefy Boxes and Bandwidth Generously Provided by pair Networks Joe
go ahead... be a heretic
 
PerlMonks  

Module Development

by CloneArmyCommander (Friar)
on Feb 18, 2005 at 22:16 UTC ( #432548=perlquestion: print w/ replies, xml ) Need Help??
CloneArmyCommander has asked for the wisdom of the Perl Monks concerning the following question:

I feel that I have been using perl long enough that I would really like to start conrtibuting back (I am a strong believer in the GNU approach to programming ;), so my question is not to a specific piece of code, but development in general.

I was reading through Programming Perl (again ;), and I was reading through the section that speaks on developing modules. I figured that many of our CPAN contributors lurk around the monastery, so I figure I will ask advice here. I am mostly looking for general infomation, but to kindof formalize my question into something that would be a good question. . . .

QUESTION:
  • Are there any good resources that will take me through the steps of developing a good (and useful) module?
  • Are there any words of advice from any module develpers here that might help me along?
I assume that I am not the only one here who has this question on their mind, so I thought it would be of some use to post this for others who are in the same situation :). Thanks in advance for any help you might be able to give me.

Comment on Module Development
Re: Module Development
by itub (Priest) on Feb 18, 2005 at 22:54 UTC
Re: Module Development
by holli (Monsignor) on Feb 18, 2005 at 22:58 UTC
Re: Module Development
by sh1tn (Priest) on Feb 18, 2005 at 23:35 UTC
Re: Module Development
by perlfan (Deacon) on Feb 19, 2005 at 02:11 UTC
    Damian Conway's "Object Oriented Perl" is a must read. On the way to learning oop Perl, you also learn how to write a good module. Additionally, "h2xs" is good for creating the standard module directory structure - even if you are not using XS.

    Also, don't forget about info presented in Simple Module Tutorial.
      h2xs is terrible for creating the standard module directory structure, because that's all it does, and it doesn't create tests in the current best format. That's why I created Module::Starter.

      You should use h2xs ONLY if you're using XS.

      xoxo,
      Andy

        Indeed. h2xs was certainly best practice back when it was the only tool available. But if I were writing "Object Oriented Perl" today, I'd definitely be recommending Module::Starter instead.

        And, in fact, in the book I am writing today ("Perl Best Practices") I do recommend Module::Starter.

        ;-)

        Damian

Re: Module Development
by hsmyers (Canon) on Feb 19, 2005 at 05:33 UTC
    Leave us not forget Writing Perl Modules for CPAN by Sam Tregar, APress ISBN 159059018X. Wish I'd had it before I wrote my first module. As for advice, best I can give is 'get busy!' Now is as good a time to begin as any. Good Luck!

    --hsm

    "Never try to teach a pig to sing...it wastes your time and it annoys the pig."
      I must second this recommendation. samtregar's book is very well written and a very useful book.

      TStanley
      --------
      The only thing necessary for the triumph of evil is for good men to do nothing -- Edmund Burke
Re: Module Development
by toma (Vicar) on Feb 19, 2005 at 07:40 UTC
    The old standby for creating a new pure perl module is to start with:
    h2xs -OXn MyModule cd MyModule perl Makefile.PL make make test
    and then add your code to MyModule.pm.

    Here is an XS tutorial that includes C code.

    I also tried module-starter:

    module-starter --module=MyModule --author="Me" --email="me@mine.com" cd MyModule perl Makefile.PL make test
    This behaved well after I installed the latest Test::Pod::Coverage.

    It should work perfectly the first time! - toma
Re: Module Development
by cbrandtbuffalo (Deacon) on Feb 19, 2005 at 13:27 UTC
    Another way to get your feet wet might be to look into the Phalanx project. It's a project to develop better testing suites for core Perl modules. The benefit to you, as you are thinking about writing a module, is that you can work with the maintainer of a top 100 Perl module and pick their brain a bit. You can see how they have done things, and get feedback on how they might do things differently now. Plus you'll get some testing experience and contribute to a core Perl module.

    Although it's slightly off-topic, I can't believe petdance didn't mention it :)

      a point of very high kwalitee ;)

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (7)
As of 2014-04-20 09:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (485 votes), past polls