Chapter 4
The last line tells you which test failed and where to look in test.pl for the
failing test.
The complete test script for Data::Counter is included in Listing 4 6.
Listing 4 6. Modified test.pl for Data::Counter
use Test;
BEGIN { plan tests => 2 };
use Data::Counter qw(count);
ok(1); # If we made it this far, we re ok.
# make sure count works
ok(count("one", "two", "three") == 3);
README
The README file is often a potential user's first contact with a module. When you
upload a module to CPAN, the README file is extracted and placed alongside the
module. Its job is to introduce the module and give information about installation.
The generated README (see Listing 4 7) is self explanatory. Some of the information
is redundant the header contains the version number that you'll also specify in
your module file, and the list of dependencies should be the same as the infor
mation in your Makefile.PL PREREQ_PM setting. This means that you'll have to be
careful to keep the information in the README up to date as your module changes.
Don't worry about the COPYRIGHT AND LICENSE section for now I'll be covering this
in detail later in this chapter.
Listing 4 7. README Generated by h2xs
Data/Counter version 0.01
========================
The README is used to introduce the module and provide instructions on
how to install the module, any machine dependencies it may have (for
example C compilers and installed libraries) and any other information
that should be provided before the module is installed.
A README file is required for CPAN modules since CPAN extracts the
README file from a module distribution so that people browsing the
archive can use it get an idea of the modules uses. It is usually a
good idea to provide version information here so that people can
decide whether fixes for the module are worth downloading.
110
footer
Our partners:
PHP: Hypertext Preprocessor Best Web Hosting
Java Web Hosting
Inexpensive Web Hosting
Jsp Web Hosting
Cheapest Web Hosting
Jsp Hosting
Cheap Hosting
Visionwebhosting.net Business web hosting division of Web
Design Plus. All rights reserved