Dist-Zilla Hates Tidy

It is discovery of silly mistakes day here in the Dist-pen.

Over the past few posts I have been running down a persnickety bug in my Database::Accessor system. I had first seen it while expanding and cleaning up my test cases and I thought at first I fixed it with a simple 'lib' statement and a slight change to my embedded classes. As I dug down into my test cases the bug came up again I reverted that embedded class change and added in a kludged that so at least my test cases all passed. I wasn't satisfied with this and did some more hacking and found my 'fix' was not I had a real bug, which I fixed in the end.

Today I found the root cause of my bug, I went back to play on my Windows box today and before I did a pull of my fixed code I did a quick diff and found this

Building a Software Consulting Firm

Hey, I'm not dead! I just haven't posted in a while because I've been so busy on Tau Station (which, if all goes well, will be open for everyone real soon™).

In the meantime, I've written a bit about building a software consulting firm. You might find it interesting.

If you need to outsource software development with a firm you can trust, contact us.

The Perl Conference Newsletter: 3/11/18

The latest TPC Newsletter is out!

Last round of talks submissions. CFP closes 3/18/18!

Round 1 and Round 2 Speakers/Sessions announced.

A decade of classes in Lausanne

I'll be back in Lausanne again this May...my tenth visit to UNIL and my second to EPFL. Both of these prestigious institutions were founded well before my own country became an independent nation (and UNIL actually dates back to 50 years before the first European even set foot on the Australian continent).

To celebrate a decade of visiting lectures at the University, we're going to offer a rare public performance of my classic Fun With Dead Languages presentation. It's many years since I had the chance to give the full two-hour version of this talk and I've been busily updating it for the occasion. The talk is completely free, but we do want people to register in advance if possible so we can schedule a suitable venue for it.

In addition to that event, of course, we'll still be running a full range of classes on technical and presentation topics:

Dist::Zilla is Sad or is that Happy?

Sad day here at the Dist-pen.

Today I awoke still having nagging doubts about putting a copy of 'Database::Accessor::DAD::Test' directly into 'Test::Database::Accessor::Utils'. It did get all my tests to run correctly but it still was a cheat or a kludge at best.

So today I did build and then installed ' Database::Accessor ' on my Ubuntu box as I wanted to see if I could get this little script;

use Database::Accessor;
my $in_hash = {
    view     => { name => 'People' },
    elements => [{name => 'first_name',
                            view => 'People'}, ],
my $da = Database::Accessor->new($in_hash);
my $return_str = {};
my $data       = Data::Test->new();
$da->retrieve( $data, $return_str );
  package Data::Test;
  use strict;

  sub new {
    my $class = shift;

    my $self = {};
    bless( $self, ( ref($class) || $class ) );

    return ($self);


Dist::Zilla Party Time

Its a good day for a party here in the Dist-pen.

A milestone here today in the Dist-pen. I finally got;

t/56_retrieve.t ............. ok
t/test.t .................... ok
All tests successful.
Files=26, Tests=319, 34 wallclock secs ( 0.21 usr  0.11 sys + 31.23 cusr  1.99 csys = 33.54 CPU)
Result: PASS
[DZ] all's well; removing .build/usLuCs7LTk
So time for a praty.

Once I got though that problem I had with my last post, I quickly went through the last set of tests updating mostly the includes and the lib call and finally got the result above.

I did notice one thing I kept getting this

t/56_retrieve.t ............. Useless use of string in void context at /home/scolesj/database-accessor/.build/usLuCs7LTk/blib/lib/Database/Accessor.pm line 111.

Very Little Dist::Zilla

Only an indirect dist-pen post today.

You ever have one of those days. Your code just does not want to come together and gives you know end of grief. Well today was one of those days for me.

I left off yesterday with what I though was a solution for my problems with 't/30_view.t', by moving my 'Database::Accessor::Roles::DAD' out of Accessor.pm and into its own file. Seem I still had a problem as in the 'Database::Accessor::DAD::Test' I still had a 'use Database::Accessor;' present.

Now that was setting up a circular call to Accessor.pm, as well it was never my intention for some-one to use a DAD directly only as a call from Database::Accessor. In the next test case 't/31_elements.t' I got

RETRIEVE No Database::Accessor::Driver loaded for Data::Test Maybe you have to install a Database::Accessor::DAD::?? for it? at...
# Looks like your test exited with 2 just after 1.

Dist::Zilla Plan

Just when you think Dist-Pen is gone its back again.

Now that I have my Dist::Zilla mostly worked out with all sorts of test goodies it is time that I buckle down and finish off and or clean up all my 'Automated' level test. As an side note, the term 'Automated' tests was a little confusing for me. I eventually figured out that by automated they (however they may be?) mean test that CPANTS will run. Normally these are the test in your 't' dir.

Myself I guess I must just be old school as I always called these module tests and it wasn't until I embarked on my Dist::Zilla trip that I have come to see the advantage of splitting your tests that really have noting to do with the function or you module, POD, spelling, Kwalitee etc, into the hand 'xt' dir.

Stupid Lucene Tricks: Full-Text Search Without the Full Text

This is a really stupid (and kludgy) Stupid Lucene Trick: how do you search the full text of your document + metadata without the full text? Simple - you create a separate field (call it fulltext, for example), then populate it with the text of all of your other fields. Voilà! You can now search against "fulltext" for all of the text in your Lucene document without having to know whether, for example, "physical" is in the document body, the abstract, or only in the keywords.

Note that fulltext should be created dynamically from the fields for the particular document, rather than from a fixed set of named fields so you maximize the amount of text you can search against.

And yes, you are duplicating the text of the all of the other fields in this field :(.

Lunatics, Perl, and Java

So I don't forget this - my expanded version of something our Larry Wall once said:

"Looking at Perl code, it is easy to tell whether you are looking at the ravings of a lunatic. With Java, you can be several weeks into the project before you realize that you are dealing with the demented discourse of someone who should be trusted with nothing sharper than a spoon."

Is this the End for Dist::Zilla??

The last round of test case review here at the Dist-Pen today.

Down to the final few today;


This is the mother of all 'Author' test cases. This little chap wraps the 'Test::Code::TidyAll' case for you which will both tidy test and a validation test on you r code. Like TidyAll you can configure it to a very high degree. For my Database::Accessor project it is a nice to have so I will give it a good try. First you have to spend a half hour or so installing all the little parts of TidyAll, there are about twenty seven plug-ins plus other little bits. The plug-in requires that a config file is present, I just copied this one from CPAN . After getting that file all you need to do is add this to you '.ini' file


Using Docker to Check for Prerequisites

While updating Set::Jaccard::SimilarityCoefficient to v1.6.1, I realized that I should install it on a clean, clean system so I find all missing prerequisites (not just the ones I already knew about). So where do I get a clean, clean system? Aha - a minimal Docker container (like the plain-vanilla Ubuntu 16.04 LTS) would be just the ticket as I am using an Ubuntu 16.04 LTS laptop. As an example, here are the steps I ran through:

  • Run: "sudo docker run -v /home/mark/src/perllib/Set-Jaccard-SimilarityCoefficient/Set-Jaccard-SimilarityCoefficient-1.6.0:/Set-Jaccard-SimilarityCoefficient-1.6.0 -it ubuntu".

  • Because this is a plain-vanilla Ubuntu, I need to install some development tools (including missing pieces of Perl) by running: "apt-get update; apt-get install gcc make perl-modules-5.22". Followed by: "cpan -i App::cpanminus"

(If anyone points out in the comments how I could use the direct "curl" install for "cpanm" rather than using "cpan", I will update these directions.)

Set::Jaccard::SimilarityCoefficient v1.6.1 Released

Somehow I missed most of the prerequisites for Set::Jaccard::SimilarityCoefficient, so I have released a version v1.6.1 that:

  • Has all of the prerequisites in the Makefile.PL.

  • Uses the new (and internally simpler and more correct) ReadonlyX instead of the retired warhorse Readonly.

  • Has additional Kwalitee tests in t-kwalitee/.* (All Kwalitee tests pass.)

(This passes most of "perlcritic --theme pbp" except for the unknown word in POD and the POD before END checks.)


Dist::Zilla Improved POD

laying with another seven sisters here is the Dist-Pen today

Well the good news for today seems Dist::Zilla::Plugin::Test::Legal is finally pointing to the correct version at meta::cpan I guess if finally got indexed. Now on with today’s review of seven more Test case Plug-ins.


An 'Author' level test case that implements Test::Pod::No404s this is one for me as I can't tell you how annoying it is to have links that point to nowhere in your POD. So after the usual five minutes or so of installing from cpan I added

to my '.ini' and gave 'dzil xtest author/pod-no' a go and got;

Help improving the Perl Maven Tutorial!

As you might know I wrote the Perl Maven Tutorial along with most of the 800 other posts on the Perl Maven site during the past 6 years or so.

It became the most frequently read Perl Tutorial and the site is the 4th most visited Perl-related site after cpan.org, perl.org, and perlmonks.org.

I've received many comments on the individual articles that make up the Perl Tutorial. Some required and immediate fix or answer, but many included suggestions that need a lot more work to implement.

There are also a number of missing articles. Some can be seen as comments in the source of the Perl Tutorial page.

It is time to update the tutorial incorporating the comments made on the individual pages,
filling in holes where some topics have not been covered, and making the whole tutorial more like pages of a book.

I need your help in two ways:

  1. Helping with the content (the source can be found on GitHub)
  2. Helping with the funding via Indiegogo, PayPal, or Patreon

Perl 5 Porters Mailing List Summary: February 19th - March 4th

Hey everyone,

Following is the p5p (Perl 5 Porters) mailing list summary for the past two weeks.


Dist::Zilla Get More Friends

Plug-in test day yet again here in the Dist-Pen.

After getting my Legal test to work in yesterday's post, funny thin is metacpan still show ver 0.02 as the latest not 0.03 for some reason, I am going to plink away at seven more sisters today;


This one is a 'Release' test case for those out there that will do not automatically increment their version in some way. At this point I want to try, once I get all my testing in order, to use the Dist::Zilla::plug-in::Git::NextVersion plug-in so I will leave this one out for now, but will keep is in the tool bin just in case I can't play nice with my GitHub account.

YAML::PP Grant Report February 2018

Hi there,

I had another busy month and did only hack a bit. I'm even so busy that I forget to use my time tracker, so I estimate about 20 hours.

See also my previous reports on blogs.perl.org (Aug/Sep, Oct, Nov, Dec, Jan )

Dist::Zilla Hates Bugs

Today in the Dist-Pen I am going to have a quick Post-ette.

In yesterday’s post I was a little disappointed with Dist::Zilla::Plugin::Test::Legal not working, so for today’s post I was going to have a look at it and see why.

Well to start off I did do a force install yesterday which is never a good way to do things but I was a little short of time. Looking at the code in Dist::Zilla::Plugin::Test::Legal the part I we are interested in is only a few lines long;

__[ xt/release/test-legal.t ]__
use strict;
use warnings;
use Test::More;
eval 'use Test::Legal';
plan skip_all => 'Test::Legal required for testing licenses'
  if $@

Strings in YAML - To Quote or not to Quote

This article covers scalar styles in YAML 1.1 and 1.2. It mostly works the same in both versions.

YAML is a data serialization language, and one design goal was that it's human friendly. It should be easy to read and edit, even if that makes parsing it harder.

Let's look at strings, specifically.

If you look at JSON, you have only one style to encode strings, and that's the double quoted style which doesn't allow literal linebreaks.

YAML files are used for many different purposes, and there are many types of strings, especially multiline strings. For each use case, you can choose the type of quoting (or no quoting) that makes the string readable and easy to edit.

This gives you lots of freedom, but you also have to learn using it to avoid mistakes.

About blogs.perl.org

blogs.perl.org is a common blogging platform for the Perl community. Written in Perl and offering the modern features you’ve come to expect in blog platforms, the site is hosted by Dave Cross and Aaron Crane, with a design donated by Six Apart, Ltd.