Possibly writing a CPAN module

jfluhmann on 2006-08-07T20:22:30

As I've started trying to become more involved in the Perl community (starting a local PM group, contributing to win32.perl.org, offering a yapc bid, volunteering), I have been considering putting a module on CPAN. I have some reading up to do in order to prepare a module to be worthy of CPAN, but I'm up for it.

At my previous job, I maintained an IIS server for 400+ web accounts and users. The "old" way of creating new accounts was to manually:

  • create a 'New User' for the new account with a 'Real Name' description and a random password
  • create a folder for the new account
  • set the permissions on the folder
  • create the new website in IIS
  • create a new ftp account in IIS
  • e-mail the maintainer of the new site their information (instructions, username, password, etc)
I quickly grew tired of the "old" way, so I automated it. I setup a page that allowed me to type in the desired username and 'Real Name' for the new account, as well as the new account's contact e-mail. The page would then send it off to the server to do everything for me and mail the information to the new account's contact.

I had to do a lot of researching to figure out how to create a 'new website' on IIS in Perl (not just a virtual site). There wasn't much out there (or I wasn't using the right search terms).

I've been in a different job for almost a year now, but out of curiosity, I did a quick search on CPAN for anything relating to IIS and found only ONE IIS admin module. I'll probably do some work this week and see what happens.

If anyone has any advice, comments, or recommendations to offer, please do so. I appreciate any feedback.


Writing Perl Modules for CPAN

dagolden on 2006-08-07T21:40:22

On the technical side of writing a module, Sam Tregar's book "Writing Perl Modules for CPAN" is pretty good on the topic. It's slightly dated (Module::Build has come a long way), but really gives a great step-by-step view of the process. It makes it seem really easy.

On the design side of things, I really encourage you to playtest your API. Write sample code that would use your module. (Test are good for that, hint, hint.)

Also, the XP practice of YAGNI (You Ain't Gonna Need It) is a good one to think about at first. Write something simple that works well for the common cases before trying to write something that supports all the options and bells and whistles. Obviously, there's a natural tension between this suggestion and the previous one -- that's the design space that you'll be exploring.

Best of luck!

Re:Writing Perl Modules for CPAN

jfluhmann on 2006-08-11T20:47:59

Thanks, David! I'm going through some of the testing now. When I initially wrote parts of it (for work), it was pretty specific to my situation, no tests, and documentation was a crap shoot. I've recently (about a month ago) picked up Ian and chromatic's 'Perl Testing: A Developer's Notebook'. I've started incorporating testing into my new code and hope that it becomes second nature in the near future.

Also, since this will be my first CPAN submission, it will definitely follow the practice of YAGNI. It will be fairly basic. I have to get my feet wet before I jump in ;-)