Creating and Uploading
CPAN Modules
How to prepare a module for distribution and how
to get it uploaded to CPAN
Presenter
● Len Jaffe
● Columbus, OH
● Programmer @ 2Checkout.com
● Just Another Hack Perler since 1990
● ljaffe@2co.com
●...
PAUSE
● The Perl programming Authors Upload Server
● This is where you upload your distro for
indexing and mirroring by th...
Request a PAUSE Account
● https://pause.perl.org/pause/query
Request a PAUSE account
● You'll get email
● Also sent to modules@perl.org mailing list
● Mailing list archive at
http://w...
Register a namespace
● Namespace for your module
● VendorAPI::2Checkout::Client
● Log into PAUSE, submit the form.
● Recei...
Register a Namespace
Module-starter
● Use module-starter to bootstrap your distro
Generated Files
Changes and ignore.txt
README
Makefile.PL
Tests and Module
Write code and Tests
Write Tests and Code
Change Boilerplate
perl Makefile.Pl
MYMETA.yml
Modify Makefile.PL
MYMETA.pl auto updated
.bak files and .old files, etc.
Lather-rinse-repeat
● It's an interative process.
● Write code and tests
● Make test
● Fix failures
● 20 goto 10
Make manifest
● Will include everything in the directory.
● Don't want EVERYTHING, just some things
● MANIFEST.SKIP
● Rege...
MANIFEST.SKIP
Make distribution
Upload to pause
Upload to PAUSE
Upload to PAUSE
CPAN Entered Email
PAUSE Indexer Email
Suddenly CPAN
Eventually CPAN
Support it
CPAN testers
● Collective of Perlers running automated testing
tools to test every module against every build.
● cpanteste...
Dependencies
Dependencies
Big Finish
● Process is well documented, and well indexed
on the web.
● Two web forms, some Perl hacking, and
another web ...
Upcoming SlideShare
Loading in …5
×

Beginners' Guide To Creating and Uploading CPAN Modules

387 views
331 views

Published on

I wrote this in 2011 to present at YAPC::NA in Asheville, NC. It was a 20-minute presentation, using screen shots rather than a live exercise.

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
387
On SlideShare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
0
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Beginners' Guide To Creating and Uploading CPAN Modules

  1. 1. Creating and Uploading CPAN Modules How to prepare a module for distribution and how to get it uploaded to CPAN
  2. 2. Presenter ● Len Jaffe ● Columbus, OH ● Programmer @ 2Checkout.com ● Just Another Hack Perler since 1990 ● ljaffe@2co.com ● lenjaffe@jaffesystems.com ● www.theycomewithcheese.com
  3. 3. PAUSE ● The Perl programming Authors Upload Server ● This is where you upload your distro for indexing and mirroring by the CPAN
  4. 4. Request a PAUSE Account ● https://pause.perl.org/pause/query
  5. 5. Request a PAUSE account ● You'll get email ● Also sent to modules@perl.org mailing list ● Mailing list archive at http://www.xray.mpe.mpg.de/mailing- lists/modules ● Read http://www.cpan.org/modules/04pause.html for gory details.
  6. 6. Register a namespace ● Namespace for your module ● VendorAPI::2Checkout::Client ● Log into PAUSE, submit the form. ● Receive email. Maybe haggle with moderators over the name. ● Now name your module after the namespace and upload it.
  7. 7. Register a Namespace
  8. 8. Module-starter ● Use module-starter to bootstrap your distro
  9. 9. Generated Files
  10. 10. Changes and ignore.txt
  11. 11. README
  12. 12. Makefile.PL
  13. 13. Tests and Module
  14. 14. Write code and Tests
  15. 15. Write Tests and Code
  16. 16. Change Boilerplate
  17. 17. perl Makefile.Pl
  18. 18. MYMETA.yml
  19. 19. Modify Makefile.PL
  20. 20. MYMETA.pl auto updated
  21. 21. .bak files and .old files, etc.
  22. 22. Lather-rinse-repeat ● It's an interative process. ● Write code and tests ● Make test ● Fix failures ● 20 goto 10
  23. 23. Make manifest ● Will include everything in the directory. ● Don't want EVERYTHING, just some things ● MANIFEST.SKIP ● Regexes. - skip files that match
  24. 24. MANIFEST.SKIP
  25. 25. Make distribution
  26. 26. Upload to pause
  27. 27. Upload to PAUSE
  28. 28. Upload to PAUSE
  29. 29. CPAN Entered Email
  30. 30. PAUSE Indexer Email
  31. 31. Suddenly CPAN
  32. 32. Eventually CPAN
  33. 33. Support it
  34. 34. CPAN testers ● Collective of Perlers running automated testing tools to test every module against every build. ● cpantesters.org ● They will test your distro and the results will be collated. ● Dependencies link on the distro's cpan.org page.
  35. 35. Dependencies
  36. 36. Dependencies
  37. 37. Big Finish ● Process is well documented, and well indexed on the web. ● Two web forms, some Perl hacking, and another web form. ● Further reading: ● CPAN Testers Kwalitee score ● More toolchain goodies: Module::Build, Module::Install, Module::Starter plugins, Dist::Zilla

×