SlideShare ist ein Scribd-Unternehmen logo
1 von 15
Creating Perl modules
with Dist::Zilla
Mark Gardner
mjgardner@cpan.org
What is this about?
• Perl modules are a set of related functions in a file.
• They’re designed to be reusable by other modules or programs.
• Therefore useful to you:
• Collect useful functions in one place, stop copying and pasting code
• And useful to others:
• You too can be a CPAN author!
• There are many many ways to create modules; this is how I do it.
• Dist::Zilla makes it really easy.
• If you want to do it a different way go ahead – TIMTOWTDI
How easy is this?
• One-time setup:
cpan -i Dist::Zilla or ppm install Dist-Zilla
installs many (160) prerequisites
dzil setup
• Make a new module:
dzil new My::Module
cd My-Module
dzil build
What does Dist::Zilla do?
• Builds scaffolding and boilerplate for a CPAN-ready Perl module
distribution
• README, LICENSE, MANIFEST, META.yml and/or META.json,
Makefile.PL or Build.PL, lib/, bin/, t/ …
• Manages the building, testing, installation and release of distributions
during development
• Extensible through plugins and plugin bundles to handle other repetitive
tasks
• Prerequsites
• Version numbers
• Documentation
• Testing
• Saves you (the developer) time and stress
What doesn’t Dist::Zilla do?
• It’s not a system for users to install released or published code.
• It doesn’t make you write object (or any other kind of) oriented code.
• It doesn’t make you change existing code if you don’t want to.
Put your modules in lib/
• In lib/My/Module.pm:
use strict;
use warnings;
package My::Module;
# your code goes here
1;
• Scripts go in bin/ if you have them.
The dist.ini file
name = My-Module
author = Mark Gardner <mjgardner@cpan.org>
license = Perl_5
copyright_holder = Aria Systems, Inc.
copyright_year = 2013
version = 0.001
[@Basic]
The Basic plugin bundle
• Does not change your code
• Generates MANIFEST, Makefile.PL, META.yml, README
• Allows easy release to CPAN
• If you want to do more, add/change plugins in dist.ini
• perldoc Dist::Zilla::PluginBundle::Basic for more
Handling prerequisites in dist.ini
• Manually:
[Prereqs]
Sub::Exporter = 0.979
Acme::ProgressBar = 0
• Automatically:
[AutoPrereqs]
• Use both if AutoPrereqs doesn’t do what you want.
Handling documentation with
Pod::Weaver
• In dist.ini:
[PodWeaver]
• Makes Pod sections for
NAME, VERSION, AUTHOR, COPYRIGHT
AND LICENSE
• Gathers things like methods into a
METHODS section
• In your code:
use strict;
use warnings;
package My::Module;
# ABSTRACT: my cool module
=head1 SYNOPSIS
use My::Module;
=method foo
=cut
# your code goes here
1;
Managing version numbers (several
plugins)
• Putting them in the right places
• [PkgVersion] and [OurPkgVersion]
• [NextRelease]
• [Git::Tag]
• Automatically manage numbering
• [AutoVersion]
• [VersionFromModule]
• [Git::NextVersion]
Testing
• prove -lr t
• Runs all tests in t/ using libraries in lib/
• Does not take advantage of Dist::Zilla changes to your code
• But it’s fast!
• dzil test
• Builds a temporary copy and runs its tests
• Should do exactly what end-user testing will do
• Can be slower since it’s building the distribution first
Releasing to CPAN
[TestRelease]
[ConfirmRelease]
[UploadToCPAN]
• PAUSE credentials in either ~/.pause or ~/.dzil/config.ini
dzil release
• For trial (not for automatic update) releases:
dzil release --trial
Many many more techniques and plugins
• Custom profiles for multiple dist.ini and directory layouts
• Pod::Weaver plugins for custom sections, encodings, etc.
• Integration with Git, GitHub, Twitter, TravisCI, etc.
• Automatic generation of web services clients
• Building for other package managers like RPM amd Dpkg
• Commands and tests for Perl::Tidy, Devel::Cover, Perl::Critic, etc.
• Dist::Zilla users often become Dist::Zilla extenders
Thank you!
http://dzil.org/
https://metacpan.org/module/Dist::Zilla
https://github.com/rjbs/dist-zilla/
irc://irc.perl.org/distzilla

Weitere ähnliche Inhalte

Was ist angesagt?

Ansible Tutorial For Beginners | What Is Ansible And How It Works? | Ansible ...
Ansible Tutorial For Beginners | What Is Ansible And How It Works? | Ansible ...Ansible Tutorial For Beginners | What Is Ansible And How It Works? | Ansible ...
Ansible Tutorial For Beginners | What Is Ansible And How It Works? | Ansible ...Simplilearn
 
Php psr standard 2014 01-22
Php psr standard 2014 01-22Php psr standard 2014 01-22
Php psr standard 2014 01-22Võ Duy Tuấn
 
Ansible + WordPress
Ansible + WordPressAnsible + WordPress
Ansible + WordPressAlan Lok
 
Network Automation: Ansible 101
Network Automation: Ansible 101Network Automation: Ansible 101
Network Automation: Ansible 101APNIC
 
Laravel introduction
Laravel introductionLaravel introduction
Laravel introductionSimon Funk
 
CPAN Exporter modules for Perl 5
CPAN Exporter modules for Perl 5CPAN Exporter modules for Perl 5
CPAN Exporter modules for Perl 5neilbowers
 
Deploying Symfony | symfony.cat
Deploying Symfony | symfony.catDeploying Symfony | symfony.cat
Deploying Symfony | symfony.catPablo Godel
 
Symfony2 Introduction Presentation
Symfony2 Introduction PresentationSymfony2 Introduction Presentation
Symfony2 Introduction PresentationNerd Tzanetopoulos
 
Making the Most of Modern PHP in Drupal 7
Making the Most of Modern PHP in Drupal 7Making the Most of Modern PHP in Drupal 7
Making the Most of Modern PHP in Drupal 7Ryan Szrama
 
[WSO2Con EU 2017] An Overview of Ballerina Composer
[WSO2Con EU 2017] An Overview of Ballerina Composer[WSO2Con EU 2017] An Overview of Ballerina Composer
[WSO2Con EU 2017] An Overview of Ballerina ComposerWSO2
 
Grâce aux tags Varnish, j'ai switché ma prod sur Raspberry Pi
Grâce aux tags Varnish, j'ai switché ma prod sur Raspberry PiGrâce aux tags Varnish, j'ai switché ma prod sur Raspberry Pi
Grâce aux tags Varnish, j'ai switché ma prod sur Raspberry PiJérémy Derussé
 
Ansible + WordPress - WordCamp Toronto 2016
Ansible + WordPress - WordCamp Toronto 2016Ansible + WordPress - WordCamp Toronto 2016
Ansible + WordPress - WordCamp Toronto 2016Alan Lok
 
Php hypertext pre-processor
Php   hypertext pre-processorPhp   hypertext pre-processor
Php hypertext pre-processorSiddique Ibrahim
 

Was ist angesagt? (20)

Ansible Tutorial For Beginners | What Is Ansible And How It Works? | Ansible ...
Ansible Tutorial For Beginners | What Is Ansible And How It Works? | Ansible ...Ansible Tutorial For Beginners | What Is Ansible And How It Works? | Ansible ...
Ansible Tutorial For Beginners | What Is Ansible And How It Works? | Ansible ...
 
Php psr standard 2014 01-22
Php psr standard 2014 01-22Php psr standard 2014 01-22
Php psr standard 2014 01-22
 
Extending ansible
Extending ansibleExtending ansible
Extending ansible
 
Composer
ComposerComposer
Composer
 
Os Bubna
Os BubnaOs Bubna
Os Bubna
 
Ansible + WordPress
Ansible + WordPressAnsible + WordPress
Ansible + WordPress
 
Introduction to php
Introduction to phpIntroduction to php
Introduction to php
 
Network Automation: Ansible 101
Network Automation: Ansible 101Network Automation: Ansible 101
Network Automation: Ansible 101
 
PHP Presentation
PHP PresentationPHP Presentation
PHP Presentation
 
Laravel introduction
Laravel introductionLaravel introduction
Laravel introduction
 
Laravel ppt
Laravel pptLaravel ppt
Laravel ppt
 
Creating custom themes in AtoM
Creating custom themes in AtoMCreating custom themes in AtoM
Creating custom themes in AtoM
 
CPAN Exporter modules for Perl 5
CPAN Exporter modules for Perl 5CPAN Exporter modules for Perl 5
CPAN Exporter modules for Perl 5
 
Deploying Symfony | symfony.cat
Deploying Symfony | symfony.catDeploying Symfony | symfony.cat
Deploying Symfony | symfony.cat
 
Symfony2 Introduction Presentation
Symfony2 Introduction PresentationSymfony2 Introduction Presentation
Symfony2 Introduction Presentation
 
Making the Most of Modern PHP in Drupal 7
Making the Most of Modern PHP in Drupal 7Making the Most of Modern PHP in Drupal 7
Making the Most of Modern PHP in Drupal 7
 
[WSO2Con EU 2017] An Overview of Ballerina Composer
[WSO2Con EU 2017] An Overview of Ballerina Composer[WSO2Con EU 2017] An Overview of Ballerina Composer
[WSO2Con EU 2017] An Overview of Ballerina Composer
 
Grâce aux tags Varnish, j'ai switché ma prod sur Raspberry Pi
Grâce aux tags Varnish, j'ai switché ma prod sur Raspberry PiGrâce aux tags Varnish, j'ai switché ma prod sur Raspberry Pi
Grâce aux tags Varnish, j'ai switché ma prod sur Raspberry Pi
 
Ansible + WordPress - WordCamp Toronto 2016
Ansible + WordPress - WordCamp Toronto 2016Ansible + WordPress - WordCamp Toronto 2016
Ansible + WordPress - WordCamp Toronto 2016
 
Php hypertext pre-processor
Php   hypertext pre-processorPhp   hypertext pre-processor
Php hypertext pre-processor
 

Andere mochten auch

Embedding customer insight into the corporate culture Cheryl Coppell, London ...
Embedding customer insight into the corporate culture Cheryl Coppell, London ...Embedding customer insight into the corporate culture Cheryl Coppell, London ...
Embedding customer insight into the corporate culture Cheryl Coppell, London ...localinsight
 
5 secrets of dominating google search
5 secrets of dominating google search5 secrets of dominating google search
5 secrets of dominating google searchMegan Hargroder
 
Grafico diario del dax perfomance index para el 09 08-2013
Grafico diario del dax perfomance index para el 09 08-2013Grafico diario del dax perfomance index para el 09 08-2013
Grafico diario del dax perfomance index para el 09 08-2013Experiencia Trading
 
Regalate una escapada a la naturaleza
Regalate una escapada a la naturalezaRegalate una escapada a la naturaleza
Regalate una escapada a la naturalezaPaloma Cambero Varela
 
JS-resume final
JS-resume finalJS-resume final
JS-resume finalJuan Silva
 
Inovatyon microfranquia v3
Inovatyon microfranquia v3 Inovatyon microfranquia v3
Inovatyon microfranquia v3 Wellisson Araujo
 
Understanding Open Licensing: Day Three - Progressing Towards Opennes
Understanding Open Licensing: Day Three - Progressing Towards OpennesUnderstanding Open Licensing: Day Three - Progressing Towards Opennes
Understanding Open Licensing: Day Three - Progressing Towards OpennesIDS Knowledge Services
 
Quelles qualifications et certifications RGE pour quels travaux ?
Quelles qualifications et certifications RGE pour quels travaux ?Quelles qualifications et certifications RGE pour quels travaux ?
Quelles qualifications et certifications RGE pour quels travaux ?Isocell France
 
Leica disto bluetooth and apps getting started on i os
Leica disto bluetooth and apps getting started on i osLeica disto bluetooth and apps getting started on i os
Leica disto bluetooth and apps getting started on i osCurtis Woodward
 
Apresentatçao total one 07 08-2015
Apresentatçao total one 07 08-2015Apresentatçao total one 07 08-2015
Apresentatçao total one 07 08-2015Wellisson Araujo
 
Resolución pliegos nutrición adulto mayor
Resolución pliegos nutrición adulto mayorResolución pliegos nutrición adulto mayor
Resolución pliegos nutrición adulto mayorAlcaldiacocorna
 
Peshawar to Pittsburgh
Peshawar to PittsburghPeshawar to Pittsburgh
Peshawar to PittsburghAmy Armstrong
 
Verruga Peruana: An Infectious Endemic Angiomatosis
Verruga Peruana: An Infectious Endemic AngiomatosisVerruga Peruana: An Infectious Endemic Angiomatosis
Verruga Peruana: An Infectious Endemic AngiomatosisDr. Juan Rodriguez-Tafur
 
The history of the happy ballroom
The history of the happy ballroomThe history of the happy ballroom
The history of the happy ballroom1066heritage
 

Andere mochten auch (20)

てすと4
てすと4てすと4
てすと4
 
My Architecture Portfolio 2015
My Architecture Portfolio 2015My Architecture Portfolio 2015
My Architecture Portfolio 2015
 
Embedding customer insight into the corporate culture Cheryl Coppell, London ...
Embedding customer insight into the corporate culture Cheryl Coppell, London ...Embedding customer insight into the corporate culture Cheryl Coppell, London ...
Embedding customer insight into the corporate culture Cheryl Coppell, London ...
 
Mba análisis del proceso de la gestion ambiental en colombia a partir del t...
Mba  análisis del proceso de la gestion ambiental en colombia a partir del t...Mba  análisis del proceso de la gestion ambiental en colombia a partir del t...
Mba análisis del proceso de la gestion ambiental en colombia a partir del t...
 
5 secrets of dominating google search
5 secrets of dominating google search5 secrets of dominating google search
5 secrets of dominating google search
 
Grafico diario del dax perfomance index para el 09 08-2013
Grafico diario del dax perfomance index para el 09 08-2013Grafico diario del dax perfomance index para el 09 08-2013
Grafico diario del dax perfomance index para el 09 08-2013
 
Regalate una escapada a la naturaleza
Regalate una escapada a la naturalezaRegalate una escapada a la naturaleza
Regalate una escapada a la naturaleza
 
Mba estrategia clase3a
Mba estrategia clase3aMba estrategia clase3a
Mba estrategia clase3a
 
WorkBC Employment Services Center
WorkBC Employment Services CenterWorkBC Employment Services Center
WorkBC Employment Services Center
 
JS-resume final
JS-resume finalJS-resume final
JS-resume final
 
Inovatyon microfranquia v3
Inovatyon microfranquia v3 Inovatyon microfranquia v3
Inovatyon microfranquia v3
 
Understanding Open Licensing: Day Three - Progressing Towards Opennes
Understanding Open Licensing: Day Three - Progressing Towards OpennesUnderstanding Open Licensing: Day Three - Progressing Towards Opennes
Understanding Open Licensing: Day Three - Progressing Towards Opennes
 
Quelles qualifications et certifications RGE pour quels travaux ?
Quelles qualifications et certifications RGE pour quels travaux ?Quelles qualifications et certifications RGE pour quels travaux ?
Quelles qualifications et certifications RGE pour quels travaux ?
 
Leica disto bluetooth and apps getting started on i os
Leica disto bluetooth and apps getting started on i osLeica disto bluetooth and apps getting started on i os
Leica disto bluetooth and apps getting started on i os
 
Apresentatçao total one 07 08-2015
Apresentatçao total one 07 08-2015Apresentatçao total one 07 08-2015
Apresentatçao total one 07 08-2015
 
Sue-Helen FFC App 16Jan2014
Sue-Helen FFC App 16Jan2014Sue-Helen FFC App 16Jan2014
Sue-Helen FFC App 16Jan2014
 
Resolución pliegos nutrición adulto mayor
Resolución pliegos nutrición adulto mayorResolución pliegos nutrición adulto mayor
Resolución pliegos nutrición adulto mayor
 
Peshawar to Pittsburgh
Peshawar to PittsburghPeshawar to Pittsburgh
Peshawar to Pittsburgh
 
Verruga Peruana: An Infectious Endemic Angiomatosis
Verruga Peruana: An Infectious Endemic AngiomatosisVerruga Peruana: An Infectious Endemic Angiomatosis
Verruga Peruana: An Infectious Endemic Angiomatosis
 
The history of the happy ballroom
The history of the happy ballroomThe history of the happy ballroom
The history of the happy ballroom
 

Ähnlich wie Creating Perl modules with Dist::Zilla

Dist::Zilla - A very brief introduction
Dist::Zilla - A very brief introductionDist::Zilla - A very brief introduction
Dist::Zilla - A very brief introductionDean Hamstead
 
Packaging perl (LPW2010)
Packaging perl (LPW2010)Packaging perl (LPW2010)
Packaging perl (LPW2010)p3castro
 
Proxying DBI with DBD::Gofer and App::Staticperl
Proxying DBI with DBD::Gofer and App::StaticperlProxying DBI with DBD::Gofer and App::Staticperl
Proxying DBI with DBD::Gofer and App::Staticperlnohuhu
 
Building and Maintaining a Distribution in Drupal 7 with Features
Building and Maintaining a  Distribution in Drupal 7 with FeaturesBuilding and Maintaining a  Distribution in Drupal 7 with Features
Building and Maintaining a Distribution in Drupal 7 with FeaturesNuvole
 
Building a Drupal Distribution using Features, Drush Make, Installation Profi...
Building a Drupal Distribution using Features, Drush Make, Installation Profi...Building a Drupal Distribution using Features, Drush Make, Installation Profi...
Building a Drupal Distribution using Features, Drush Make, Installation Profi...Ben Shell
 
Make your CPAN module static installable
Make your CPAN module static installableMake your CPAN module static installable
Make your CPAN module static installableShoichi Kaji
 
Drupal 8 - Core and API Changes
Drupal 8 - Core and API ChangesDrupal 8 - Core and API Changes
Drupal 8 - Core and API ChangesShabir Ahmad
 
perlbrew yapcasia 2010
perlbrew yapcasia 2010perlbrew yapcasia 2010
perlbrew yapcasia 2010Kang-min Liu
 
PyCourse - Self driving python course
PyCourse - Self driving python coursePyCourse - Self driving python course
PyCourse - Self driving python courseEran Shlomo
 
Becoming A Drupal Master Builder
Becoming A Drupal Master BuilderBecoming A Drupal Master Builder
Becoming A Drupal Master BuilderPhilip Norton
 
Efficient development workflows with composer
Efficient development workflows with composerEfficient development workflows with composer
Efficient development workflows with composernuppla
 
Using Grunt with Drupal
Using Grunt with DrupalUsing Grunt with Drupal
Using Grunt with Drupalarithmetric
 
Your first d8 module
Your first d8 moduleYour first d8 module
Your first d8 moduletedbow
 
DrupalCon LA 2015 Review
DrupalCon LA 2015 ReviewDrupalCon LA 2015 Review
DrupalCon LA 2015 ReviewlittleMAS
 
Puppet Camp Portland: Nagios Management With Puppet (Beginner)
Puppet Camp Portland: Nagios Management With Puppet (Beginner)Puppet Camp Portland: Nagios Management With Puppet (Beginner)
Puppet Camp Portland: Nagios Management With Puppet (Beginner)Puppet
 
Resources for Navigating Drupal Upgrades: Versions 6 Through 8 And What It Me...
Resources for Navigating Drupal Upgrades: Versions 6 Through 8 And What It Me...Resources for Navigating Drupal Upgrades: Versions 6 Through 8 And What It Me...
Resources for Navigating Drupal Upgrades: Versions 6 Through 8 And What It Me...Steve Kessler
 
Puppet Camp Denver 2015: Nagios Management With Puppet
Puppet Camp Denver 2015: Nagios Management With PuppetPuppet Camp Denver 2015: Nagios Management With Puppet
Puppet Camp Denver 2015: Nagios Management With PuppetPuppet
 
Drupal upgrades and migrations. BAD Camp 2013 version
Drupal upgrades and migrations. BAD Camp 2013 versionDrupal upgrades and migrations. BAD Camp 2013 version
Drupal upgrades and migrations. BAD Camp 2013 versionDavid Lanier
 
Efficient development workflows with composer
Efficient development workflows with composerEfficient development workflows with composer
Efficient development workflows with composernuppla
 
Dev traning 2016 symfony
Dev traning 2016   symfonyDev traning 2016   symfony
Dev traning 2016 symfonySacheen Dhanjie
 

Ähnlich wie Creating Perl modules with Dist::Zilla (20)

Dist::Zilla - A very brief introduction
Dist::Zilla - A very brief introductionDist::Zilla - A very brief introduction
Dist::Zilla - A very brief introduction
 
Packaging perl (LPW2010)
Packaging perl (LPW2010)Packaging perl (LPW2010)
Packaging perl (LPW2010)
 
Proxying DBI with DBD::Gofer and App::Staticperl
Proxying DBI with DBD::Gofer and App::StaticperlProxying DBI with DBD::Gofer and App::Staticperl
Proxying DBI with DBD::Gofer and App::Staticperl
 
Building and Maintaining a Distribution in Drupal 7 with Features
Building and Maintaining a  Distribution in Drupal 7 with FeaturesBuilding and Maintaining a  Distribution in Drupal 7 with Features
Building and Maintaining a Distribution in Drupal 7 with Features
 
Building a Drupal Distribution using Features, Drush Make, Installation Profi...
Building a Drupal Distribution using Features, Drush Make, Installation Profi...Building a Drupal Distribution using Features, Drush Make, Installation Profi...
Building a Drupal Distribution using Features, Drush Make, Installation Profi...
 
Make your CPAN module static installable
Make your CPAN module static installableMake your CPAN module static installable
Make your CPAN module static installable
 
Drupal 8 - Core and API Changes
Drupal 8 - Core and API ChangesDrupal 8 - Core and API Changes
Drupal 8 - Core and API Changes
 
perlbrew yapcasia 2010
perlbrew yapcasia 2010perlbrew yapcasia 2010
perlbrew yapcasia 2010
 
PyCourse - Self driving python course
PyCourse - Self driving python coursePyCourse - Self driving python course
PyCourse - Self driving python course
 
Becoming A Drupal Master Builder
Becoming A Drupal Master BuilderBecoming A Drupal Master Builder
Becoming A Drupal Master Builder
 
Efficient development workflows with composer
Efficient development workflows with composerEfficient development workflows with composer
Efficient development workflows with composer
 
Using Grunt with Drupal
Using Grunt with DrupalUsing Grunt with Drupal
Using Grunt with Drupal
 
Your first d8 module
Your first d8 moduleYour first d8 module
Your first d8 module
 
DrupalCon LA 2015 Review
DrupalCon LA 2015 ReviewDrupalCon LA 2015 Review
DrupalCon LA 2015 Review
 
Puppet Camp Portland: Nagios Management With Puppet (Beginner)
Puppet Camp Portland: Nagios Management With Puppet (Beginner)Puppet Camp Portland: Nagios Management With Puppet (Beginner)
Puppet Camp Portland: Nagios Management With Puppet (Beginner)
 
Resources for Navigating Drupal Upgrades: Versions 6 Through 8 And What It Me...
Resources for Navigating Drupal Upgrades: Versions 6 Through 8 And What It Me...Resources for Navigating Drupal Upgrades: Versions 6 Through 8 And What It Me...
Resources for Navigating Drupal Upgrades: Versions 6 Through 8 And What It Me...
 
Puppet Camp Denver 2015: Nagios Management With Puppet
Puppet Camp Denver 2015: Nagios Management With PuppetPuppet Camp Denver 2015: Nagios Management With Puppet
Puppet Camp Denver 2015: Nagios Management With Puppet
 
Drupal upgrades and migrations. BAD Camp 2013 version
Drupal upgrades and migrations. BAD Camp 2013 versionDrupal upgrades and migrations. BAD Camp 2013 version
Drupal upgrades and migrations. BAD Camp 2013 version
 
Efficient development workflows with composer
Efficient development workflows with composerEfficient development workflows with composer
Efficient development workflows with composer
 
Dev traning 2016 symfony
Dev traning 2016   symfonyDev traning 2016   symfony
Dev traning 2016 symfony
 

Kürzlich hochgeladen

A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdfChristopherTHyatt
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 

Kürzlich hochgeladen (20)

A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 

Creating Perl modules with Dist::Zilla

  • 1. Creating Perl modules with Dist::Zilla Mark Gardner mjgardner@cpan.org
  • 2. What is this about? • Perl modules are a set of related functions in a file. • They’re designed to be reusable by other modules or programs. • Therefore useful to you: • Collect useful functions in one place, stop copying and pasting code • And useful to others: • You too can be a CPAN author! • There are many many ways to create modules; this is how I do it. • Dist::Zilla makes it really easy. • If you want to do it a different way go ahead – TIMTOWTDI
  • 3. How easy is this? • One-time setup: cpan -i Dist::Zilla or ppm install Dist-Zilla installs many (160) prerequisites dzil setup • Make a new module: dzil new My::Module cd My-Module dzil build
  • 4. What does Dist::Zilla do? • Builds scaffolding and boilerplate for a CPAN-ready Perl module distribution • README, LICENSE, MANIFEST, META.yml and/or META.json, Makefile.PL or Build.PL, lib/, bin/, t/ … • Manages the building, testing, installation and release of distributions during development • Extensible through plugins and plugin bundles to handle other repetitive tasks • Prerequsites • Version numbers • Documentation • Testing • Saves you (the developer) time and stress
  • 5. What doesn’t Dist::Zilla do? • It’s not a system for users to install released or published code. • It doesn’t make you write object (or any other kind of) oriented code. • It doesn’t make you change existing code if you don’t want to.
  • 6. Put your modules in lib/ • In lib/My/Module.pm: use strict; use warnings; package My::Module; # your code goes here 1; • Scripts go in bin/ if you have them.
  • 7. The dist.ini file name = My-Module author = Mark Gardner <mjgardner@cpan.org> license = Perl_5 copyright_holder = Aria Systems, Inc. copyright_year = 2013 version = 0.001 [@Basic]
  • 8. The Basic plugin bundle • Does not change your code • Generates MANIFEST, Makefile.PL, META.yml, README • Allows easy release to CPAN • If you want to do more, add/change plugins in dist.ini • perldoc Dist::Zilla::PluginBundle::Basic for more
  • 9. Handling prerequisites in dist.ini • Manually: [Prereqs] Sub::Exporter = 0.979 Acme::ProgressBar = 0 • Automatically: [AutoPrereqs] • Use both if AutoPrereqs doesn’t do what you want.
  • 10. Handling documentation with Pod::Weaver • In dist.ini: [PodWeaver] • Makes Pod sections for NAME, VERSION, AUTHOR, COPYRIGHT AND LICENSE • Gathers things like methods into a METHODS section • In your code: use strict; use warnings; package My::Module; # ABSTRACT: my cool module =head1 SYNOPSIS use My::Module; =method foo =cut # your code goes here 1;
  • 11. Managing version numbers (several plugins) • Putting them in the right places • [PkgVersion] and [OurPkgVersion] • [NextRelease] • [Git::Tag] • Automatically manage numbering • [AutoVersion] • [VersionFromModule] • [Git::NextVersion]
  • 12. Testing • prove -lr t • Runs all tests in t/ using libraries in lib/ • Does not take advantage of Dist::Zilla changes to your code • But it’s fast! • dzil test • Builds a temporary copy and runs its tests • Should do exactly what end-user testing will do • Can be slower since it’s building the distribution first
  • 13. Releasing to CPAN [TestRelease] [ConfirmRelease] [UploadToCPAN] • PAUSE credentials in either ~/.pause or ~/.dzil/config.ini dzil release • For trial (not for automatic update) releases: dzil release --trial
  • 14. Many many more techniques and plugins • Custom profiles for multiple dist.ini and directory layouts • Pod::Weaver plugins for custom sections, encodings, etc. • Integration with Git, GitHub, Twitter, TravisCI, etc. • Automatic generation of web services clients • Building for other package managers like RPM amd Dpkg • Commands and tests for Perl::Tidy, Devel::Cover, Perl::Critic, etc. • Dist::Zilla users often become Dist::Zilla extenders