Wednesday, February 28, 2007

installing a Perl module

So shoot me. I haven't done this in a long time. I was trying to install XML::Writer and forgot how to install a Perl module. Here are the steps:

1) download the module as a gzipped tar
2) uncompress the file:
[root@computer Desktop]# tar zxvf XML-Writer-0.602.tar.gz
XML-Writer-0.602/
XML-Writer-0.602/Writer.pm
XML-Writer-0.602/META.yml
XML-Writer-0.602/Changes
XML-Writer-0.602/t/
XML-Writer-0.602/t/pod-coverage.t
XML-Writer-0.602/t/pod.t
XML-Writer-0.602/t/01_main.t
XML-Writer-0.602/MANIFEST
XML-Writer-0.602/TODO
XML-Writer-0.602/README
XML-Writer-0.602/Makefile.PL

Change into the install directory and create the Makefile
[root@computer Desktop]# cd XML-Writer-0.602
[root@computer XML-Writer-0.602]# perl Makefile.PL
Checking if your kit is complete...
Looks good
Writing Makefile for XML::Writer

Run "make" to create the module
[root@computer XML-Writer-0.602]# make
cp Writer.pm blib/lib/XML/Writer.pm
Manifying blib/man3/XML::Writer.3pm

Run "make test" to test your new module
[root@computer XML-Writer-0.602]# make test
PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/01_main.........ok
t/pod-coverage....skipped
all skipped: Test::Pod::Coverage required for testing pod coverage
t/pod.............skipped
all skipped: Test::Pod 1.00 required for testing POD
All tests successful, 2 tests skipped.
Files=3, Tests=213, 1 wallclock secs ( 0.54 cusr + 0.43 csys = 0.97 CPU)

Run "make install" to install the module in its proper place
[root@computer XML-Writer-0.602]# make install
Installing /usr/lib/perl5/site_perl/5.8.6/XML/Writer.pm
Installing /usr/share/man/man3/XML::Writer.3pm
Writing /usr/lib/perl5/site_perl/5.8.6/i386-linux-thread-multi/auto/XML/Writer/.packlist
Appending installation info to /usr/lib/perl5/5.8.6/i386-linux-thread-multi/perllocal.pod

that's it!

No comments:

Feel free to drop me a line or ask me a question.