I highly recommend you to read the book "Effective Perl Programming", written by Joseph Hall and Randal Schwartz, if you want to develop a good perl programming habit and style. There are a few
book review threads on Perl monks site for this book. The ISBN number is ISBN-0-201-41975-0.
There is a chapter in the book on Writing Packages and Modules. The method recommended by the author is to use the h2xs program included in your Perl distribution.
Example:
To create a new module File::Cmp -
h2xs -A -X -n File::Cmp
It will generate the files:
File/Cmp/Cmp.pm
File/Cmp/Makefile.PL
File/Cmp/test.pl
File/Cmp/Changes
File/Cmp/MANIFEST
These files are a great starting point to further develop your perl module.
Then in your application, you just add this to the beginning of the perl script:
use File::Cmp;
....