SILENT KILLERPanel

Current Path: > > > usr > share > perl5 > pod


Operation   : Linux premium131.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64
Software     : Apache
Server IP    : 162.0.232.56 | Your IP: 216.73.216.111
Domains      : 1034 Domain(s)
Permission   : [ 0755 ]

Files and Folders in: ///usr/share/perl5/pod

NameTypeSizeLast ModifiedActions
perl.pod File 16270 bytes July 28 2025 08:07:09.
perl5004delta.pod File 56240 bytes July 28 2025 08:07:09.
perl5005delta.pod File 34283 bytes July 28 2025 08:07:09.
perl5100delta.pod File 55535 bytes July 28 2025 08:07:09.
perl5101delta.pod File 43888 bytes July 28 2025 08:07:09.
perl5120delta.pod File 89272 bytes July 28 2025 08:07:09.
perl5121delta.pod File 10141 bytes July 28 2025 08:07:09.
perl5122delta.pod File 9603 bytes July 28 2025 08:07:09.
perl5123delta.pod File 4100 bytes July 28 2025 08:07:09.
perl5124delta.pod File 3672 bytes July 28 2025 08:07:09.
perl5125delta.pod File 7683 bytes July 28 2025 08:07:09.
perl5140delta.pod File 144324 bytes July 28 2025 08:07:09.
perl5141delta.pod File 7966 bytes July 28 2025 08:07:09.
perl5142delta.pod File 6892 bytes July 28 2025 08:07:09.
perl5143delta.pod File 7760 bytes July 28 2025 08:07:09.
perl5144delta.pod File 6327 bytes July 28 2025 08:07:09.
perl5160delta.pod File 133651 bytes July 28 2025 08:07:09.
perl5161delta.pod File 6142 bytes July 28 2025 08:07:09.
perl5162delta.pod File 3594 bytes July 28 2025 08:07:09.
perl5163delta.pod File 4085 bytes July 28 2025 08:07:09.
perl5180delta.pod File 119431 bytes July 28 2025 08:07:09.
perl5181delta.pod File 6595 bytes July 28 2025 08:07:09.
perl5182delta.pod File 5335 bytes July 28 2025 08:07:09.
perl5184delta.pod File 4642 bytes July 28 2025 08:07:09.
perl5200delta.pod File 115699 bytes July 28 2025 08:07:09.
perl5201delta.pod File 10899 bytes July 28 2025 08:07:09.
perl5202delta.pod File 12509 bytes July 28 2025 08:07:09.
perl5203delta.pod File 9392 bytes July 28 2025 08:07:09.
perl5220delta.pod File 130963 bytes July 28 2025 08:07:09.
perl5221delta.pod File 10767 bytes July 28 2025 08:07:09.
perl5222delta.pod File 12629 bytes July 28 2025 08:07:09.
perl5223delta.pod File 8456 bytes July 28 2025 08:07:09.
perl5224delta.pod File 4460 bytes July 28 2025 08:07:09.
perl5240delta.pod File 64927 bytes July 28 2025 08:07:09.
perl5241delta.pod File 8215 bytes July 28 2025 08:07:09.
perl5242delta.pod File 4113 bytes July 28 2025 08:07:09.
perl5243delta.pod File 11428 bytes July 28 2025 08:07:09.
perl5244delta.pod File 4510 bytes July 28 2025 08:07:09.
perl5260delta.pod File 101836 bytes July 28 2025 08:07:09.
perl5261delta.pod File 7927 bytes July 28 2025 08:07:09.
perl5262delta.pod File 7880 bytes July 28 2025 08:07:09.
perl5263delta.pod File 7063 bytes July 28 2025 08:07:09.
perl5280delta.pod File 72113 bytes July 28 2025 08:07:09.
perl561delta.pod File 124713 bytes July 28 2025 08:07:09.
perl56delta.pod File 107201 bytes July 28 2025 08:07:09.
perl581delta.pod File 38061 bytes July 28 2025 08:07:09.
perl582delta.pod File 4470 bytes July 28 2025 08:07:09.
perl583delta.pod File 6335 bytes July 28 2025 08:07:09.
perl584delta.pod File 7363 bytes July 28 2025 08:07:09.
perl585delta.pod File 5889 bytes July 28 2025 08:07:09.
perl586delta.pod File 4651 bytes July 28 2025 08:07:09.
perl587delta.pod File 8357 bytes July 28 2025 08:07:09.
perl588delta.pod File 25272 bytes July 28 2025 08:07:09.
perl589delta.pod File 53900 bytes July 28 2025 08:07:09.
perl58delta.pod File 115165 bytes July 28 2025 08:07:09.
perlaix.pod File 20437 bytes July 28 2025 08:07:09.
perlamiga.pod File 5749 bytes July 28 2025 08:07:09.
perlandroid.pod File 7871 bytes July 28 2025 08:07:09.
perlapi.pod File 443535 bytes July 28 2025 08:07:09.
perlapio.pod File 19285 bytes July 28 2025 08:07:09.
perlartistic.pod File 7010 bytes July 28 2025 08:07:09.
perlbook.pod File 8338 bytes July 28 2025 08:07:09.
perlboot.pod File 294 bytes July 28 2025 08:07:09.
perlbot.pod File 304 bytes July 28 2025 08:07:09.
perlbs2000.pod File 8058 bytes July 28 2025 08:07:09.
perlcall.pod File 56706 bytes July 28 2025 08:07:09.
perlce.pod File 14602 bytes July 28 2025 08:07:09.
perlcheat.pod File 4481 bytes July 28 2025 08:07:09.
perlclib.pod File 9619 bytes July 28 2025 08:07:09.
perlcn.pod File 4691 bytes July 28 2025 08:07:09.
perlcommunity.pod File 7217 bytes July 28 2025 08:07:09.
perlcygwin.pod File 27199 bytes July 28 2025 08:07:09.
perldata.pod File 46743 bytes July 28 2025 08:07:09.
perldbmfilter.pod File 4981 bytes July 28 2025 08:07:09.
perldebguts.pod File 38535 bytes July 28 2025 08:07:09.
perldebtut.pod File 22152 bytes July 28 2025 08:07:09.
perldebug.pod File 39258 bytes July 28 2025 08:07:09.
perldelta.pod File 7063 bytes July 28 2025 08:07:09.
perldeprecation.pod File 18169 bytes July 28 2025 08:07:09.
perldiag.pod File 284572 bytes July 28 2025 08:07:09.
perldos.pod File 10522 bytes July 28 2025 08:07:09.
perldsc.pod File 25614 bytes July 28 2025 08:07:09.
perldtrace.pod File 7958 bytes July 28 2025 08:07:09.
perlebcdic.pod File 84233 bytes July 28 2025 08:07:09.
perlembed.pod File 37196 bytes July 28 2025 08:07:09.
perlexperiment.pod File 7195 bytes July 28 2025 08:07:09.
perlfork.pod File 13355 bytes July 28 2025 08:07:09.
perlform.pod File 16608 bytes July 28 2025 08:07:09.
perlfreebsd.pod File 1610 bytes July 28 2025 08:07:09.
perlfunc.pod File 392957 bytes July 28 2025 08:07:09.
perlgit.pod File 33509 bytes July 28 2025 08:07:09.
perlgpl.pod File 13815 bytes July 28 2025 08:07:09.
perlguts.pod File 139329 bytes July 28 2025 08:07:09.
perlhack.pod File 40445 bytes July 28 2025 08:07:09.
perlhacktips.pod File 55509 bytes July 28 2025 08:07:09.
perlhacktut.pod File 6153 bytes July 28 2025 08:07:09.
perlhaiku.pod File 1508 bytes July 28 2025 08:07:09.
perlhist.pod File 53546 bytes July 28 2025 08:07:09.
perlhpux.pod File 30509 bytes July 28 2025 08:07:09.
perlhurd.pod File 1993 bytes July 28 2025 08:07:09.
perlintern.pod File 54572 bytes July 28 2025 08:07:09.
perlinterp.pod File 33687 bytes July 28 2025 08:07:09.
perlintro.pod File 22119 bytes July 28 2025 08:07:09.
perliol.pod File 34185 bytes July 28 2025 08:07:09.
perlipc.pod File 70829 bytes July 28 2025 08:07:09.
perlirix.pod File 4395 bytes July 28 2025 08:07:09.
perljp.pod File 7521 bytes July 28 2025 08:07:09.
perlko.pod File 12259 bytes July 28 2025 08:07:09.
perllexwarn.pod File 355 bytes July 28 2025 08:07:09.
perllinux.pod File 1488 bytes July 28 2025 08:07:09.
perllocale.pod File 68678 bytes July 28 2025 08:07:09.
perllol.pod File 9580 bytes July 28 2025 08:07:09.
perlmacos.pod File 1001 bytes July 28 2025 08:07:09.
perlmacosx.pod File 12060 bytes July 28 2025 08:07:09.
perlmod.pod File 26250 bytes July 28 2025 08:07:09.
perlmodinstall.pod File 12792 bytes July 28 2025 08:07:09.
perlmodlib.pod File 76482 bytes July 28 2025 08:07:09.
perlmodstyle.pod File 22575 bytes July 28 2025 08:07:09.
perlmroapi.pod File 3212 bytes July 28 2025 08:07:09.
perlnetware.pod File 6648 bytes July 28 2025 08:07:09.
perlnewmod.pod File 11036 bytes July 28 2025 08:07:09.
perlnumber.pod File 8353 bytes July 28 2025 08:07:09.
perlobj.pod File 35537 bytes July 28 2025 08:07:09.
perlootut.pod File 26783 bytes July 28 2025 08:07:09.
perlop.pod File 136252 bytes July 28 2025 08:07:09.
perlopenbsd.pod File 1204 bytes July 28 2025 08:07:09.
perlopentut.pod File 9455 bytes July 28 2025 08:07:09.
perlos2.pod File 93351 bytes July 28 2025 08:07:09.
perlos390.pod File 15674 bytes July 28 2025 08:07:09.
perlos400.pod File 4768 bytes July 28 2025 08:07:09.
perlpacktut.pod File 51282 bytes July 28 2025 08:07:09.
perlperf.pod File 49881 bytes July 28 2025 08:07:09.
perlplan9.pod File 5125 bytes July 28 2025 08:07:09.
perlpod.pod File 22196 bytes July 28 2025 08:07:09.
perlpodspec.pod File 68476 bytes July 28 2025 08:07:09.
perlpolicy.pod File 25629 bytes July 28 2025 08:07:09.
perlport.pod File 87602 bytes July 28 2025 08:07:09.
perlpragma.pod File 5176 bytes July 28 2025 08:07:09.
perlqnx.pod File 6673 bytes July 28 2025 08:07:09.
perlre.pod File 120901 bytes July 28 2025 08:07:09.
perlreapi.pod File 30334 bytes July 28 2025 08:07:09.
perlrebackslash.pod File 31817 bytes July 28 2025 08:07:09.
perlrecharclass.pod File 49029 bytes July 28 2025 08:07:09.
perlref.pod File 35304 bytes July 28 2025 08:07:09.
perlreftut.pod File 18790 bytes July 28 2025 08:07:09.
perlreguts.pod File 38328 bytes July 28 2025 08:07:09.
perlrepository.pod File 509 bytes July 28 2025 08:07:09.
perlrequick.pod File 18497 bytes July 28 2025 08:07:09.
perlreref.pod File 14744 bytes July 28 2025 08:07:09.
perlretut.pod File 121257 bytes July 28 2025 08:07:09.
perlriscos.pod File 1529 bytes July 28 2025 08:07:09.
perlrun.pod File 53550 bytes July 28 2025 08:07:09.
perlsec.pod File 26184 bytes July 28 2025 08:07:09.
perlsolaris.pod File 29822 bytes July 28 2025 08:07:09.
perlsource.pod File 6876 bytes July 28 2025 08:07:09.
perlstyle.pod File 8630 bytes July 28 2025 08:07:09.
perlsub.pod File 72967 bytes July 28 2025 08:07:09.
perlsymbian.pod File 15359 bytes July 28 2025 08:07:09.
perlsyn.pod File 44512 bytes July 28 2025 08:07:09.
perlsynology.pod File 7778 bytes July 28 2025 08:07:09.
perlthrtut.pod File 46459 bytes July 28 2025 08:07:09.
perltie.pod File 38607 bytes July 28 2025 08:07:09.
perltoc.pod File 694171 bytes July 28 2025 08:07:09.
perltodo.pod File 376 bytes July 28 2025 08:07:09.
perltooc.pod File 294 bytes July 28 2025 08:07:09.
perltoot.pod File 294 bytes July 28 2025 08:07:09.
perltrap.pod File 10620 bytes July 28 2025 08:07:09.
perltru64.pod File 8492 bytes July 28 2025 08:07:09.
perltw.pod File 4477 bytes July 28 2025 08:07:09.
perlunicode.pod File 82491 bytes July 28 2025 08:07:09.
perlunicook.pod File 25488 bytes July 28 2025 08:07:09.
perlunifaq.pod File 13647 bytes July 28 2025 08:07:09.
perluniintro.pod File 38340 bytes July 28 2025 08:07:09.
perluniprops.pod File 285306 bytes July 28 2025 08:07:09.
perlunitut.pod File 7951 bytes July 28 2025 08:07:09.
perlutil.pod File 7640 bytes July 28 2025 08:08:32.
perlvar.pod File 78364 bytes July 28 2025 08:07:09.
perlvms.pod File 50823 bytes July 28 2025 08:07:09.
perlvos.pod File 3843 bytes July 28 2025 08:07:09.
perlwin32.pod File 39298 bytes July 28 2025 08:07:09.
perlxs.pod File 78920 bytes July 28 2025 08:07:09.
perlxstut.pod File 50095 bytes July 28 2025 08:07:09.
perlxstypemap.pod File 24001 bytes July 28 2025 08:07:09.

Reading File: ///usr/share/perl5/pod/perlnewmod.pod

=head1 NAME

perlnewmod - preparing a new module for distribution

=head1 DESCRIPTION

This document gives you some suggestions about how to go about writing
Perl modules, preparing them for distribution, and making them available
via CPAN.

One of the things that makes Perl really powerful is the fact that Perl
hackers tend to want to share the solutions to problems they've faced,
so you and I don't have to battle with the same problem again.

The main way they do this is by abstracting the solution into a Perl
module. If you don't know what one of these is, the rest of this
document isn't going to be much use to you. You're also missing out on
an awful lot of useful code; consider having a look at L<perlmod>,
L<perlmodlib> and L<perlmodinstall> before coming back here.

When you've found that there isn't a module available for what you're
trying to do, and you've had to write the code yourself, consider
packaging up the solution into a module and uploading it to CPAN so that
others can benefit.

You should also take a look at L<perlmodstyle> for best practices in
making a module.

=head2 Warning

We're going to primarily concentrate on Perl-only modules here, rather
than XS modules. XS modules serve a rather different purpose, and
you should consider different things before distributing them - the
popularity of the library you are gluing, the portability to other
operating systems, and so on. However, the notes on preparing the Perl
side of the module and packaging and distributing it will apply equally
well to an XS module as a pure-Perl one.

=head2 What should I make into a module?

You should make a module out of any code that you think is going to be
useful to others. Anything that's likely to fill a hole in the communal
library and which someone else can slot directly into their program. Any
part of your code which you can isolate and extract and plug into
something else is a likely candidate.

Let's take an example. Suppose you're reading in data from a local
format into a hash-of-hashes in Perl, turning that into a tree, walking
the tree and then piping each node to an Acme Transmogrifier Server.

Now, quite a few people have the Acme Transmogrifier, and you've had to
write something to talk the protocol from scratch - you'd almost
certainly want to make that into a module. The level at which you pitch
it is up to you: you might want protocol-level modules analogous to
L<Net::SMTP|Net::SMTP> which then talk to higher level modules analogous
to L<Mail::Send|Mail::Send>. The choice is yours, but you do want to get
a module out for that server protocol.

Nobody else on the planet is going to talk your local data format, so we
can ignore that. But what about the thing in the middle? Building tree
structures from Perl variables and then traversing them is a nice,
general problem, and if nobody's already written a module that does
that, you might want to modularise that code too.

So hopefully you've now got a few ideas about what's good to modularise.
Let's now see how it's done.

=head2 Step-by-step: Preparing the ground

Before we even start scraping out the code, there are a few things we'll
want to do in advance.

=over 3

=item Look around

Dig into a bunch of modules to see how they're written. I'd suggest
starting with L<Text::Tabs|Text::Tabs>, since it's in the standard
library and is nice and simple, and then looking at something a little
more complex like L<File::Copy|File::Copy>.  For object oriented
code, L<WWW::Mechanize> or the C<Email::*> modules provide some good
examples.

These should give you an overall feel for how modules are laid out and
written.

=item Check it's new

There are a lot of modules on CPAN, and it's easy to miss one that's
similar to what you're planning on contributing. Have a good plough
through L<http://metacpan.org> and make sure you're not the one
reinventing the wheel!

=item Discuss the need

You might love it. You might feel that everyone else needs it. But there
might not actually be any real demand for it out there. If you're unsure
about the demand your module will have, consider asking the
C<module-authors@perl.org> mailing list (send an email to
C<module-authors-subscribe@perl.org> to subscribe; see
L<http://lists.perl.org/list/module-authors.html> for more information
and a link to the archives).

=item Choose a name

Perl modules included on CPAN have a naming hierarchy you should try to
fit in with. See L<perlmodlib> for more details on how this works, and
browse around CPAN and the modules list to get a feel of it. At the very
least, remember this: modules should be title capitalised, (This::Thing)
fit in with a category, and explain their purpose succinctly.

=item Check again

While you're doing that, make really sure you haven't missed a module
similar to the one you're about to write.

When you've got your name sorted out and you're sure that your module is
wanted and not currently available, it's time to start coding.

=back

=head2 Step-by-step: Making the module

=over 3

=item Start with F<module-starter> or F<h2xs>

The F<module-starter> utility is distributed as part of the
L<Module::Starter|Module::Starter> CPAN package.  It creates a directory
with stubs of all the necessary files to start a new module, according
to recent "best practice" for module development, and is invoked from
the command line, thus:

    module-starter --module=Foo::Bar \
       --author="Your Name" --email=yourname@cpan.org

If you do not wish to install the L<Module::Starter|Module::Starter>
package from CPAN, F<h2xs> is an older tool, originally intended for the
development of XS modules, which comes packaged with the Perl
distribution. 

A typical invocation of L<h2xs|h2xs> for a pure Perl module is:

    h2xs -AX --skip-exporter --use-new-tests -n Foo::Bar 

The C<-A> omits the Autoloader code, C<-X> omits XS elements,
C<--skip-exporter> omits the Exporter code, C<--use-new-tests> sets up a
modern testing environment, and C<-n> specifies the name of the module.

=item Use L<strict|strict> and L<warnings|warnings>

A module's code has to be warning and strict-clean, since you can't
guarantee the conditions that it'll be used under. Besides, you wouldn't
want to distribute code that wasn't warning or strict-clean anyway,
right?

=item Use L<Carp|Carp>

The L<Carp|Carp> module allows you to present your error messages from
the caller's perspective; this gives you a way to signal a problem with
the caller and not your module. For instance, if you say this:

    warn "No hostname given";

the user will see something like this:

 No hostname given at
 /usr/local/lib/perl5/site_perl/5.6.0/Net/Acme.pm line 123.

which looks like your module is doing something wrong. Instead, you want
to put the blame on the user, and say this:

    No hostname given at bad_code, line 10.

You do this by using L<Carp|Carp> and replacing your C<warn>s with
C<carp>s. If you need to C<die>, say C<croak> instead. However, keep
C<warn> and C<die> in place for your sanity checks - where it really is
your module at fault.

=item Use L<Exporter|Exporter> - wisely!

L<Exporter|Exporter> gives you a standard way of exporting symbols and
subroutines from your module into the caller's namespace. For instance,
saying C<use Net::Acme qw(&frob)> would import the C<frob> subroutine.

The package variable C<@EXPORT> will determine which symbols will get
exported when the caller simply says C<use Net::Acme> - you will hardly
ever want to put anything in there. C<@EXPORT_OK>, on the other hand,
specifies which symbols you're willing to export. If you do want to
export a bunch of symbols, use the C<%EXPORT_TAGS> and define a standard
export set - look at L<Exporter> for more details.

=item Use L<plain old documentation|perlpod>

The work isn't over until the paperwork is done, and you're going to
need to put in some time writing some documentation for your module.
C<module-starter> or C<h2xs> will provide a stub for you to fill in; if
you're not sure about the format, look at L<perlpod> for an
introduction. Provide a good synopsis of how your module is used in
code, a description, and then notes on the syntax and function of the
individual subroutines or methods. Use Perl comments for developer notes
and POD for end-user notes.

=item Write tests

You're encouraged to create self-tests for your module to ensure it's
working as intended on the myriad platforms Perl supports; if you upload
your module to CPAN, a host of testers will build your module and send
you the results of the tests. Again, C<module-starter> and C<h2xs>
provide a test framework which you can extend - you should do something
more than just checking your module will compile.
L<Test::Simple|Test::Simple> and L<Test::More|Test::More> are good
places to start when writing a test suite.

=item Write the F<README>

If you're uploading to CPAN, the automated gremlins will extract the
README file and place that in your CPAN directory. It'll also appear in
the main F<by-module> and F<by-category> directories if you make it onto
the modules list. It's a good idea to put here what the module actually
does in detail.

=item Write F<Changes>

Add any user-visible changes since the last release to your F<Changes>
file.

=back

=head2 Step-by-step: Distributing your module

=over 3

=item Get a CPAN user ID

Every developer publishing modules on CPAN needs a CPAN ID.  Visit
C<L<http://pause.perl.org/>>, select "Request PAUSE Account", and wait for
your request to be approved by the PAUSE administrators.

=item C<perl Makefile.PL; make test; make distcheck; make dist>

Once again, C<module-starter> or C<h2xs> has done all the work for you.
They produce the standard C<Makefile.PL> you see when you download and
install modules, and this produces a Makefile with a C<dist> target.

Once you've ensured that your module passes its own tests - always a
good thing to make sure - you can C<make distcheck> to make sure
everything looks OK, followed by C<make dist>, and the Makefile will
hopefully produce you a nice tarball of your module, ready for upload.

=item Upload the tarball

The email you got when you received your CPAN ID will tell you how to
log in to PAUSE, the Perl Authors Upload SErver. From the menus there,
you can upload your module to CPAN.

Alternatively you can use the F<cpan-upload> script, part of the
L<CPAN::Uploader> distribution on CPAN.

=item Fix bugs!

Once you start accumulating users, they'll send you bug reports. If
you're lucky, they'll even send you patches. Welcome to the joys of
maintaining a software project...

=back

=head1 AUTHOR

Simon Cozens, C<simon@cpan.org>

Updated by Kirrily "Skud" Robert, C<skud@cpan.org>

=head1 SEE ALSO

L<perlmod>, L<perlmodlib>, L<perlmodinstall>, L<h2xs>, L<strict>,
L<Carp>, L<Exporter>, L<perlpod>, L<Test::Simple>, L<Test::More>
L<ExtUtils::MakeMaker>, L<Module::Build>, L<Module::Starter>
L<http://www.cpan.org/>, Ken Williams' tutorial on building your own
module at L<http://mathforum.org/~ken/perl_modules.html>

SILENT KILLER Tool