Module...r::PBP(3pm)

🌸 NAME 🌸

Module::Starter::PBP β€” bestie, this is the plugin that creates a whole new Perl module exactly the way the book Perl Best Practices says you should. No cap. It's giving "scaffolding, but make it classy" πŸ’…

(oh and the manual name for this page is Module...r::PBP(3pm) β€” it lives in the User Contributed Perl Documentation section, iykyk 🫢)


πŸŽ€ VERSION πŸŽ€

This document describes Module::Starter::PBP version 0.003. Yeah she's an elder but she ATE πŸ’–


✨ SYNOPSIS ✨

Okay so first, in your ~/.module-starter/config file:

# In your  ~/.module-starter/config file...

author:  <Your Name>
email:   <your@email.addr>
plugins: Module::Starter::PBP
template_dir: </some/absolute/path/name>

Then, from the command-line:

# Then on the command-line...

> module-starter --module=Your::New::Module

Or, if you're feeling lazy and you're fully happy to just vibe with the recommendations from Perl Best Practices:

# Or, if you're lazy and happy to go with
# the recommendations in "Perl Best Practices"...

> perl -MModule::Starter::PBP=setup

πŸ¦‹ DESCRIPTION πŸ¦‹

This module implements a simple approach to creating modules and all their support files, and it's built on the Module::Starter approach. Heads up tho: Module::Starter has to be installed before this module can be used, no skipping that step bestie πŸ™ˆ

When you use it as a Module::Starter plugin, this module lets you point at a simple little directory of templates. Those templates get filled in with info that's specific to your module, and then they become the whole basis of your shiny new module. Literally the blueprint era of module creation 🧚

And the default templates it hands you right out of the box? Based on the recommendations in the book Perl Best Practices. Iconic behavior, honestly πŸ‘‘


πŸ’œ INTERFACE πŸ’œ

This module just acts as a plugin for Module::Starter. So it uses the exact same command-line interface as that module. Nothing extra, nothing weird.

Which template files it's supposed to use gets specified in your Module::Starter config file β€” you just add a template_dir configuration variable that gives the full path name of the directory where you want to keep your templates. That's it, that's the assignment πŸŽ€

The easiest way to set up this config file, the associated directory, and the necessary template files is literally just to type:

> perl -MModule::Starter::PBP=setup

on the command line. Then it's gonna ask you for your name, your email address, and the full path name of the directory where you want to keep the templates β€” and after all that, the templates get created and installed. Slay ✨

After that you can make a new module by typing:

> module-starter --module=Your::New::Module

🌸 Template format 🌸

The templates are plain files, named:

Build.PL
Makefile.PL
README
Changes
Module.pm
t/whatever_you_like.t

So here's the tea: the Module.pm file is the template for the .pm file of your module. Anything you drop into the t/ subdirectory becomes a template for your module's testing files. And all the remaining files are templates for the distribution files that share the same names. Matching set, periodt πŸ’…

Inside those files, these placeholders get replaced with the appropriate info specific to the file:

  • <AUTHOR> β€” the nominated author. Pulled straight from the author setting in your Module::Starter config file. πŸ‘‘
  • <BUILD INSTRUCTIONS> β€” the Makefile or Module::Build instructions. Computed automatically according to the builder setting in your Module::Starter config file.
  • <DATE> β€” the current date (as returned by localtime). Computed automagically ✨
  • <DISTRO> β€” the name of the complete module distribution. Computed automatically from the name of the module.
  • <EMAIL> β€” where to send feedback. Taken from the email setting in your Module::Starter config file. πŸ“§
  • <LICENSE> β€” the licence under which the module is released. Taken from the license setting in your Module::Starter config file.
  • <MAIN MODULE> β€” the name of the main module of the distribution.
  • <MAIN PM FILE> β€” the name of the .pm file for the main module.
  • <MODULE NAME> β€” the name of the current module being created within the distribution.
  • <RT NAME> β€” the name to use for bug reports to the RT system. That is:
Please report any bugs or feature requests to
bug-<RT NAME>@rt.cpan.org
  • <YEAR> β€” the current year. Computed automatically.

😭 DIAGNOSTICS 😭

These are the "bestie something went wrong" messages. Read them, they're actually telling you what's up.
  • Can't find directory that holds Module::Starter::PBP templates β€” you didn't tell Module::Starter::PBP where your templates are stored. You need a 'template_dir' specification. Typically this would go in your ~/.module-starter/config file. Something like:
template_dir: /users/you/.module-starter/Templates
  • Can't access Module::Starter::PBP template directory β€” you did specify a 'template_dir', but that path didn't lead to a readable directory. πŸ™ˆ
  • The template: %s isn't in the template directory (%s) β€” one of the required templates was missing from the template directory you specified. πŸ’€
  • The template: %s isn't readable in the template directory (%s) β€” one of the templates in the template directory you specified was not readable.
  • Unknown placeholder <%s> in %s β€” one of the templates in the template directory contained a replacement item that wasn't a known piece of information. Rude of it, honestly 😀

🌈 CONFIGURATION AND ENVIRONMENT 🌈

Go see the documentation for Module::Starter and module-starter. They've got the details 🫢


πŸ’– DEPENDENCIES πŸ’–

Requires the Module::Starter module. That's the whole list, she's low maintenance.


πŸ¦„ INCOMPATIBILITIES πŸ¦„

None reported. Clean ✨


⭐ BUGS AND LIMITATIONS ⭐

No bugs have been reported. Not a single one. Immaculate. πŸ’…

Please report any bugs or feature requests to bug-module-starter-pbp@rt.cpan.org, or through the web interface at <http://rt.cpan.org>.


πŸ‘‘ AUTHOR πŸ‘‘

Damian Conway "<DCONWAY@cpan.org>"

The one and only πŸ™Œ


Copyright (c) 2005, Damian Conway "<DCONWAY@cpan.org>". All rights reserved.

This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.


πŸ’€ DISCLAIMER OF WARRANTY πŸ’€

Bestie, this is the loud part and it matters. Read it. It is ALL CAPS for a reason. πŸ”₯

BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR, OR CORRECTION.

IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENCE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.


and that's the whole page, bestie πŸ’– this was perl v5.40.1, dated 2026-06-12, and it's filed under Module...r::PBP(3pm) in the User Contributed Perl Documentation. stay fruity, go make a module 🧚✨

πŸ“¦ where this page comes from