Contributing to a Perl module on CPAN (using vim and GitHub)
In the article on how to prepare for a Perl job interview, I mentioned that contribution to an Open Source project is an excellent way to learn new skills and make yourself marketable. In this article and screencast that was created in July 2011, I showed how contribute a little improvement to a Perl module on CPAN.
Thanks. Your video was really eye opening. It showed me that I do not need to start very big as I was thinking, small contributions like that can really lead to big ones.
- Gervase Byomujuni
It is not recommend solution any more, but back then 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 did not provide the information in its META file nor in its documentation. (BTW Already back then I saw that it was already added in the not-yet-released version, and since then the new version was uploaded).
Anyway, In this case I was lucky as I knew Ricardo (RJBS) uses Github so I went to his Github page and looked for the module. I found the repository of MIME::Lite and forked it by pressing the fork button.
Then I cloned my version of MIME::Lite to my disk using
$ git clone firstname.lastname@example.org:szabgab/mime-lite.git
I 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.