Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

17. Modules > Creating Modules

Creating Modules

Build new module frameworks automatically.

The “bones” of every new module are basically the same:

package <MODULE NAME>;

use version; our $VERSION = qv('0.0.1');
use warnings;
use strict;
use Carp;

# Module implementation here

1; # Magic true value required at end of module
__END_ _

=head1 NAME

<MODULE NAME> - [One line description of module's purpose here]

=head1 VERSION

This document describes <MODULE NAME> version 0.0.1

=head1 SYNOPSIS

    use <MODULE NAME>;

    # And the rest of the documentation template here
     # (as described in Chapter 7)

So it makes sense to create each new module automatically, reusing the same templates for each. This rule applies not just to the .pm file itself, but also to the other standard components of a module distribution: the MANIFEST file, the Makefile.PL, the Build.PL, the README, the Changes file, and the lib/ and t/ subdirectories.


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint