Packaging Perl Modules
Deepan Chakravarthy N
Center for Biotechnology
Anna University
deepan AT bioinformatics DOT org
What will I speak about ?
- How to go about writing Perl modules,
- preparing them for distribution,
- and making them available via CPAN database
http://cpan.org
What will I not speak about??
- This is not a perl tutorial
- $man perl
- $perldoc perlintro
- $perldoc perlboot
- $perldoc perlfaq
What is a perl module?
- collection of functions that perform a set of tasks that work towards a common goal (.pm extension)
- a mechanism to protect packages from stamping each others variables.
- $x is same as $main::x (main is the default name)
- package mypkg; then $x is $mypkg::x
- to use variables from other modules $othermodulename::variablename
Resolving dependency problem
- installing perl modules using tarballs lead to dependecy problem.
- use CPAN shell to avoid dependency problems
- perl Makefile.PL PREFIX=/home/user; make; make test; make install
- perl -MCPAN -e 'install WWW::Yahoo::Groups'
The CPAN Shell
- $perl -MCPAN -e shell
- $get WWW::Yahoo::Groups
- $make WWW::Yahoo::Groups
- $install WWW::Yahoo::Groups
- edit /home/user/.cpan/CPAN/MyConfig.pm
The CPAN Shell
- perl -MCPAN -e shell
- get WWW::Yahoo::Groups
- make WWW::Yahoo::Groups
- install WWW::Yahoo::Groups
- edit /home/user/.cpan/CPAN/MyConfig.pm
[any material that should appear in print but not on the slide]