Skip to content

New to Perl Development

schwern edited this page Nov 23, 2011 · 6 revisions

If you've never patched a Perl module before, this is a guide to help you get your Perl development environment setup and learn how to work with a Perl module out of its repository.

Generally useful links for those new to Perl

Setting up your Perl development environment

This isn't strictly necessary, but it will help you in the long and probably even short run.

  • We recommend you install your own copy of Perl in your user directory with perlbrew. This will isolate you from your system's Perl so it doesn't get messed up. It guarantees you have an up to date copy. Finally, you can install whatever you want without admin access.

  • We recommend you install cpanminus which is one of the simplest and friendliest CPAN clients for installing Perl modules. perlbrew can do it for you or you can follow cpanminus' normal installation instructions.

Getting the code

For a module on Github, you'll have to clone the git repository to get a copy of the code. Please see help.github.com for more information.

Satisfying the dependencies

To install a Perl module you need to first install any modules it depends on. Sometimes folks refer to this as "dependency hell". Fortunately, if you're using perlbrew and cpanminus, we can do it the easy way.

  • First, cd to the source directory of the module you just cloned.

  • Then run perl Build.PL which configures the module for installation. It should complain about a lot of missing modules. There's a lot of ways to resolve this, but we'll show you how to do it with cpanminus.

  • cpanm --installdeps . will install all the dependencies for the Perl module whose source tree you're sitting in.

  • Run perl Build.PL again and it should be happy.

  • Run perl ./Build to build the module.

  • Run perl ./Build test to run the module's tests.

  • It all worked? Great! You're ready to develop. If it didn't work, find someone to help.

Clone this wiki locally