Dist::Zilla Likes Critic

Another test play date in the Dist-Pen today.
“The covers of this book are too far apart.” ― Ambrose Bierce
hmm criticism, of a fashion, but not much good to us in the Perl world, I much prefer;
“Criticism may not be agreeable, but it is necessary. It fulfills the same function as pain in the human body; it calls attention to the development of an unhealthy state of things. If it is heeded in time, danger may be averted; if it is suppressed, a fatal distemper may develop."

― Winston S. Churchill


take on what criticism is as it shows how it can help us in the Perl world. Now that leads me to introduce our very own resident and much respected critic ' Perl::Critic

Web development with Perl 5

Even though I am in the thralls of Perl 6, I still do all my web development in Perl 5 because the ecology of modules is so mature. Here I will describe how I typically go about creating a website. For example, I will reference a small project I built for an affordable housing non-profit in Tucson (https://github.com/kyclark/metagenomics-book/tree/master/web).

Data Model

Show me your flowcharts and conceal your tables, and I shall continue to be mystified. Show me your tables, and I won’t usually need your flowcharts; they’ll be obvious. — Fred Brooks

Nothing captures my philosophy better than the above quote. Everything in my method starts from the database design and is propagated by code outward. I tend to use MySQL with InnoDB tables so that my database has foreign key constraints. (The only time I don’t use InnoDB is when I need a feature like FULLTEXT indexes.)

Here is an example schema:

Parsing JSON is a Minefield

Parsing JSON is a Minefield

And on Twitter

Paging TOBYINK

This week marks 2 years since TOBYINK seemingly dropped off the perl map, in terms of viewable open source contributions that is. Since then the author's modules have gone unmaintained, consequently they are no longer compatible with recent versions of perl. This is going to cause problems eventually.

I, and several others, have sent e-mails to TONYINK but have not received any response. So TOBYINK, where are you? Are you OK? You seem to be active in at least one place? Can you give co-maint on some of your modules that are used or recommended in more widely deployed distributions? Some of your modules are too important to leave to abandonware, and forking them is a path i (and almost certainly others) don't want to take.

Edit: Some non-essential information removed as i don't want to give people bad ideas about compatibility between Moo/Mouse/Moose due to the use in our stack.

Dist::Zilla Do Kwallitee Test

Playing with tests in the Dist-Pen today.

On part of Dist::Zilla that I do find intriguing is the way it does its testing. As I discovered in my last post some things only work at release time and that is true of testing as well. Dist:Zilla take the newer extended testing model as a default. In the old days we would call these optional tests and usually hide them in a folder someplace, but the more common usage today is to put them in an '\xt' directory on their own.

One can see the logic behind this as I remember a few times having to do a force install of a CPAN mod as the author had some sort of non-functional test in '\t' that would not pass on my perl.

Dist::Zilla this concept a little further and splits it into four types;

  1. release
  2. automated
  3. extended
  4. author

Tau Station Updates

I haven't blogged lately because of ridiculous amounts of work on the Tau Station MMORPG (the game formerly known as Veure and written almost entirely in Perl). I had reluctantly stopped my last contract with ZipRecruiter because of surgery (long story, but not life-threatening) and then experiencing the joy of physiotherapy. Near the end of physio, we decided as a company to make a serious push on Tau Station and bring it to alpha. Here's an update.

wallpaper mockup of Tau Station art

sparrow remote tasks - way to package your scripts and configurations.

Idea behind a sparrow is quite simple. You have a script, you package it as sparrow plugin and you can re-use it somewhere else.

Give me list of available plugins:

Give your first talk at the London Perl Workshop

If you've never given a talk at a Perl event before, and perhaps never given a talk at any tech event, I'd like to encourage you to give your first talk at the London Perl Workshop. I'm happy to be your LPW talk buddy, and help you prepare for it, and am confident that other people would be happy to help too.

Dist::Zilla VCS Opps!

Well in the Dist-Pen today I am going to start to play with linking my Distro back into GitHub.

There are a good number of Dist::Zilla plug-ins to be found in CPAN that work with Git and GitHub in one way or an other. Unfortunately source management and system admiration are skills that I have always lacked, so I am hoping that a few of these plug-ins added to my '.ini' will help me keep my GitHub source both up to date and stop me from making any of the VCS Opps! that I have done in the past.

So to start I installed GitHub on the box where I do my building and replicated my database-accessor GitHub repository, not going to go into that you can find a very good tutorial on that here and most likely in many other that I have not seen.

GraphViz2 V 2.43 now does image maps

https://metacpan.org/pod/GraphViz2#Image-Maps

Missing and outdated CPAN modules in Ubuntu (Debian)

Today I tried to set up the Perl Maven site on a fresh Ubuntu/xenial 16.04 using the system-perl.

Most of the CPAN modules the site needs could be installed using apt-get, but there were a few that I could not find or that were outdated.

Acme::MetaSyntactic 1.012 not found.
Business::PayPal 0.13 not found.
DBIx::RunSQL 0.12 not found.
Dancer2::Plugin::Passphrase 2.0.5 not found.
Dancer2::Session::Cookie 0 not found.
EBook::MOBI 0 not found.
MetaCPAN::Client 0 not found.
Module::Version 0 not found.
Template 2.25 not found. We have 2.24.
Test::WWW::Mechanize 1.44 not found. We have 1.42.
URL::Encode::XS 0 not found.
YAML::XS 0.59 not found. We have 0.41.

Looking for Eugene van der Pijll

Eugene van der Pijll is the author of DateTime::Calendar::Christian, which manipulates dates in either Julian or Gregorian calendars, depending on what the date actually is. This module has not been updated since 2003, and uses the DateTime language interface, that has since been deprecated in favor of locale and retracted..

I am trying to get it fixed, and am willing to adopt the module myself if that is what is necessary. I am working my way through Neil Bowers' Adopt a CPAN module. The forked and patched module can be found at GitHub. My desire is at least to get the stuff currently in GitHub into the module; that is, use the locale interface, add method today(), and document the valid values for reform_date. If I actually end up co-maintainer, I plan to fix what I see as a bug in DefaultReformDate() when the reform date is invalid, and try to flesh out missing methods in the DateTime interface.

Dist::Zilla Takes To POD

Well another post-ette day again here in the Dist-Pen getting rid of one more chore.

Yep getting rid of one more chore the programmers least favorite thing next to code-reviews documenting your code. As good Perl programer we like to use POD as our format of choice and there are quite a few Modules out there that will help you a bit and some will get you started but alas the days of self documenting code are still not here.

Dist::Zilla does have a few plug-ins to help with documenting your code and as I really just want to get rid of some of the more boring chore work of documenting I decided on using 'Dist::Zilla::Plugin::PodWeaver'

Like all plugin I just add it to the '.ini', after I installed it,

Perl 5 Porters Mailing List Summary: October 11th-17th

[edit: This was 5.22.3 released. Thank you for spotting the error, Kent Fredric!]

Hey everyone,

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

Enjoy!

Dancer2 0.204001 restores 5.8 support, fixes Test::Perl::Critic dependencies

Dancer2 0.204001 is on its way to a CPAN mirror near you. There are several important updates in this release that are worth noting:

  • Support for Perl 5.8 support has been restored. We used a named capture in a regex in resolving an issue in Dancer2 0.204000 and in the process, made Dancer2 unusable on Perl 5.8. This has been fixed. Thanks veryrusty!

  • Dancer2 0.204000 unintentionally required that Test::Perl::Critic be installed, and that we pass Perl::Critic tests to install properly. This has been reverted. We apologize for the inconvenience.

The full changelog is here:

SparrowHub Plugins Request

A quick search at github on something like Perl/Bash scripts gives me a lot of results.

As developers we more think about modules and libraries when talk about software reuse. But in our day-to-day life scripts still take a vital part. Scripts like little, but useful commands to get our job done. This is why people from many programming languages/environments tend to create a places for such a tools called repositories, so other could easily find, install and run scripts or utilities. To list a few:

Well. A SparrowHub is a attempt to make a such effort in Perl communities to create a repository of useful automation scripts. Sparrow is Perl friendly in many ways:

  • it is written on Perl
  • it gets installed as CPAN module
  • it respects carton/cpanfile dependency management for your scripts
  • it supports Config::General format for script configuration ( among JSON, YAML and command line parameters )

Well let me now turn to the essential point of my post.

Dist::Zilla Likes Change

Another Post-ette here in the dist-pen today.

As we have seen in my last post Dist::Zilla is really good at doing all those boring yet important chores for you distribution, today I am going to look at another the Changes file. All distributions should have a changes file though I would guess there are quite a few without. I do not think there is any standard format out there but usually it is just something akin to

Revision history for xxxx
Changes in xxx.xxx 

Perl Executing Browser version 0.3

Less than two months after the release of version 0.2, I can announce the release of version 0.3 of Perl Executing Browser (PEB) - our minimalistic HTML GUI for Perl desktop applications similar to Electron and NW.js.

The new version introduces strict separation between trusted and untrusted content, which can not be mixed together in one browser window. Local content and scripts, as well as all Perl-related functionality stay separated from untrusted web content in different browser windows for enhanced security of all PEB-based Perl applications.

Version 0.3 is also capable of starting Linux superuser scripts using 'gksudo'.

As usual, any feedback and suggestions are quite welcome!

Next stable DBD::SQLite will be released in mid November

DBD::SQLite 1.51_06 (with SQLite 3.15.0) is a release candidate of the next stable DBD::SQLite. As always, please test it with your modules/applications and let me know if you find anything, especially if you're using FTS because DBD::SQLite has disabled two-arg fts3_tokenizer() for security concern from the upstream. If there's no blocker nor request to wait, I'll release 1.52 in the mid November.

See Changes file in the distribution for other fixes and improvements, and see also https://www.sqlite.org/changes.html for the changes in SQLite library.

adventure with PVS-Studio C/C++ analyzer

I've recently read a promo article about a static C/C++ analyzer called PVS-Studio by viva64.com, where the readers were urged to use the product, and I did just that. Evgeniy Ryzhkov, the creator of the program kindly sent me a one-week key, and I immediately started testing some of my C/XS code.

I'm also using valgrind and was rather sure that all major problems were long gone, but how wrong I was. There were also a couple nasties, in cases not covered by tests, and thus valgrind had no chance to detect them. There were also a couple of WTFs, such as

void * x = result();
x-> something++;
if (!x) return;

where the logic was clearly there, but somehow on wrong lines. A shame really.

About blogs.perl.org

blogs.perl.org is a common blogging platform for the Perl community. Written in Perl with a graphic design donated by Six Apart, Ltd.