Developer Forums | About Us | Site Map
Search  
HOME > TUTORIALS > SERVER SIDE CODING > PERL TUTORIALS > THE ROAD TO BETTER PROGRAMMING: CHAPTER 5 MODULES AND OBJECTS


Sponsors





Useful Lists

Web Host
site hosted by netplex

Online Manuals

The road to better programming: Chapter 5 Modules and objects
By Teodor Zlatanov - 2004-03-01 Page:  1 2 3 4 5 6 7 8

h2xs: your new best friend

Don't you wish there was a tool that could write your Perl class for you, that could write a documentation (POD) skeleton as well, and generally make your life easier by doing things right? Perl comes with exactly that sort of tool: h2xs.

The important flags to remember are "-A -n Module". With those, h2xs will generate a skeleton directory called "Module" full of useful files. They are:

  • Module.pm, the module itself, with skeleton documentation already written.
  • Module.xs, for linking your module to C code. (Run "perldoc perlxs" for more information.)
  • MANIFEST, a list of files for packaging.
  • test.pl, a skeleton testing script.
  • Changes, a log of changes made to the module.
  • Makefile.PL, a makefile generator (run it with "perl Makefile.PL".)

You don't need to use all these files, but it's nice to know they are there when you do need them.



View The road to better programming: Chapter 5 Modules and objects Discussion

Page:  1 2 3 4 5 6 7 8 Next Page: Exercises and Resources

First published by IBM developerWorks


Copyright 2004-2024 GrindingGears.com. All rights reserved.
Article copyright and all rights retained by the author.