In this screencast I am showing how easy it is to contribute a little improvement to a Perl module on CPAN.
I picked the MIME::Lite distribution as it had the annoying habit to ask me if I want to add optional dependencies even when they were already installed on my system. It even asked me if I want to install File::Basename which is a standard module.
The path of action was:
Search on MetaCPAN and locate MIME::Lite to see where the source code lives. This module does not provide the information in its META file nor in its documentation. (BTW I saw that it was already added in the not-yet-released version).
Then I cloned my version of MIME::Lite to my disk using
$ git clone email@example.com:szabgab/mime-lite.git
Had an editing session using vim. In which I made some refactoring of the code and changed it so it will first check if the optional modules are already installed or not. If they are installed the version number is also checked if it is smaller than the required optional version number.
Once this was fixed I added back the changed file and committed it to my local Git repository:
$ git add Makefile.PL $ git ci -m'make optional modules optional'
Then pushed it to my remote repository on Github.
$ git push
Then went back to my version of MIME::Lite and clicked on the Pull Request button to send a message to Ricardo asking him to integrate the change.
That's it. A very small improvement to CPAN in 16 minutes.
How do you add optional dependencies? How do you make little contributions?Published on 2011-07-15 by Gabor Szabo blog comments powered by Disqus