The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Task::BeLike::FIBO -- Leonardo Pisano a.k.a. Fibonacci

CPAN version Build Status

SYNOPSIS

    cpan Task::BeLike::FIBO
    perldoc Task::BeLike::FIBO

DESCRIPTION

Hi! I am FIBO an italian mathematician. I graduated in 2005 at Università degli Studi di Genova and since then I work doing Business Intelligence and Web Analytics. My boss said: you need Perl. So I started using this language. I like many programming languages, but, Perl really help me to pay my rent.

This is a primary about my habits and a collection of modules I use when I write Perl code.

PACKAGE GUIDELINES

Do not get crazy with automatic generators. I am a mathematician and a coder, not a corporation. Every package is different and has different needings. The followings are samples for files I usually need in a package.

Just use copy and paste and your brain!

The smack of a DRY KISS is not that bad.

Learn from nature: stay as minimal as possible.

FILES

Follows a list of sample files of a package, named MY::Package for instance: GitHub repo name hence is My-Package-pm.

  • lib/My/Package.pm

    This is the main file of the package and looks something like this

        package Task::BeLike::FIBO;
        $VERSION = '0.1';
        1;
    
        __END__
    
        =encoding utf8
    
        =head1 NAME
    
        My::Package -- is yet another Perl package
    
        =begin HTML
    
        <p><a href="https://metacpan.org/pod/TaskMy::Packagerget="_blank"><img src="https://badge.fury.io/pl/TaskMy-Package" alt="CPAN version"></a> <a href="https://travis-ci.org/fibo/TaskMy-Package target="_blank"><img src="https://travis-ci.org/fibo/TaskMy-Packagesvg?branch=master" alt="Build Status"></a></p>
    
        =end HTML
    
        =head1 DESCRIPTION
    
        =head1 COPYRIGHT AND LICENSE
    
        This software is copyright (c) 2014 by G. Casati.
    
        This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
    
        =cut
  • README.md

        My-Package
        ==========
    
        My-Package description ...
    
        To install, pray the mantra
    
            perl Makefile.PL
            make
            make test
            make install
    
        For more information point your browser to [online docs](https://metacpan.org/pod/My::Package).
    
        --------
        [![CPAN version](https://badge.fury.io/pl/My-Package.svg)](https://metacpan.org/pod/My::Package)
        [![Build Status](https://travis-ci.org/fibo/My-Package-pm.png?branch=master)](https://travis-ci.org/fibo/My-Package-pm)
        [![C

    .travis.yml

        language: perl
        perl:
          - "5.18"
          - "5.16"
          - "5.14"
          - "5.12"
          - "5.10"
          - "5.8"
  • .gitignore

        .*
        *~
        !.gitignore
        !.travis.yml
        blib
        pm_to_blib
        Makefile*
        !Makefile.PL
        MANIFEST*
        !MANIFEST.SKIP
        *META.*
        *.tar.gz
  • Makefile.PL

        use strict;
        use warnings;
    
        use ExtUtils::MakeMaker 6.64;
    
        WriteMakefile(
            ABSTRACT_FROM => 'lib/My/Package.pm',
            VERSION_FROM  => 'lib/My/Package.pm',
            AUTHOR        => 'G. Casati <fibo@cpan.org>',
            NAME          => 'My::Package',
            MIN_PERL_VERSION => '5.8.0',
            META_MERGE => {
                resources => {
                    homepage   => 'https://metacpan.org/pod/My::Package'
                    license    => 'http://g14n.info/artistic-license',
                    repository => 'https://github.com/fibo/My-Package-pm',
                    bugtracker => 'https://github.com/fibo/My-Package-pm/issues',
                },
            },
            PREREQ_PM => {
                # 'Some::Package' => '0',
                # 'Other::Package' => '1.2.3',
            },
            test => { TESTS => 't/*.t' },
            TEST_REQUIRES => {
                'Test::Compile' => '1',
                'Test::More' => '1',
                'Test::Pod'  => '1',
            }
        );
  • MANIFEST.SKIP

        ^MANIFEST\.SKIP$
        ^MANIFEST\.bak$
        ^\.
        .*\.old$
        .*\.bak$
        \.tar\.gz$
        ^Makefile$
        ^MYMETA\.
        ^blib
        ^pm_to_blib
  • Changes

    It is considered a good habit to keep track of at least major changes to inform users what they should expect when upgrading version.

        2014-12-2 v0.1
        + First release

WORKFLOW

  • Start a feature branch

        $ git checkout -b somefeature
  • Write documentation about new feature. Then write tests to check it and code to implement it.

  • Run tests

        $ prove -l --state=save
  • If some test does not pass, fix code and run tests that failed

        $ prove -l --state=save,failed
  • Merge feature branch and commit work

        $ git rebase master
        $ git checkout master
        $ git merge somefeature
        $ git push
  • Update version, use Semantic Versioning.

    Create a new release

        $ perl Makefile.PL
        $ make
        $ make test
        $ make manifest
        $ make dist
        $ make realclean
  • Upload to PAUSE

        $ cpan-upload -u fibo My-Package-0.1.tar.gz
        PAUSE Password:
        registering upload with PAUSE web server
        POSTing upload for My-Package-0.1.tar.gz to https://pause.perl.org/pause/authenquery
        PAUSE add message sent ok [200]

STUFF INCLUDED

COPYRIGHT AND LICENSE

This software is copyright (c) 2014 by G. Casati.

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