-
Notifications
You must be signed in to change notification settings - Fork 42
New to Perl Development
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.
- http://learn.perl.org/ has all the basics for those new to Perl.
- chromatic's Modern Perl book is free and a great introduction to programmer Perl for reals.
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.
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.
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.