Entering MooseX, XXII Just two more

Well on to the next little module I am going to have a look at Distribution-Cooker another creation from the prolific keyboard of Brian DeFoy. Well I am batting 0-3 for another module to do what I want, fill in all the boiler plate and package up all my stuff from my MooseX modules.

While this is a nice little module like the last two it is really a starting point for module creation rather that a tool to help out packaging it.

Like the last one you simply create a template by extending the original class as you see fit and then let it go creating you blank files and then used to package them up.

Well it does have the least number of dependencies of any so far and installs in a few moments so if you are limited on the version and or mods of Perl you can install this would be the Distribution tool for you.

Perl 6 meets JSON-RPC

During Polish Perl Workshop 2014 Carl Mäsak showed us how to model Feline Hotel application.
But he forgot one thing - that cats own the Internet and they want to browse and reserve rooms online!
I will pick up where he left off and show you how to publish API and go live in a blink of an eye.


So let's create modern Feline Hotel in Perl 6!

WTF: $Test::Builder::Level is invalid

Someone started using Test::Pretty and now I can't run tests. I get:

GraphViz2::Marpa: Start ... # $Test::Builder::Level is invalid. Testing library you are using is broken. : 2 at /home/ron/perl5/perlbrew/perls/perl-5.18.2/lib/site_perl/5.18.2/Test/Version.pm line 134.

Googling didn't help.

I've run cpanm on a range of modules:
o Test::Pretty
o Test::More
o Test::Version
o Test::Exception
o TryCatch

Any ideas?

Courses with brian d foy in Switzerland

Swiss Perl Workshop, proud hosting member of this years European Perl Summer Tour presents two courses by brian d foy:

"Intermediate Perl", September 1-4 at the location of the Swiss Perl Workshop in Olten and "Mastering Perl", the week after the workshop, in the Zurich area.

Please support yourself with knowledge in Perl and our keynote speaker by wildly overbooking his courses. :-)

Entering MooseX: XXI Not the Best Superbowl Ever

Well today I am going to give the quick one-two to Toby's little creation called 'Dist::Inkt' or as the subtitle calles it Yet Another distribution builder why he didn't call it YADB I will never know but that was for hit to decided.

So a usual these days I had a quick look at the compatibility matrix on CPAN Testers and it seems to be windows friendly and the dependency list is not too bad and it seem to install ok after the usual huff and puffing on by drive.

Now the documentation is very extensive and there are plenty of very good examples and at least one profile example. So that is great what is not great is this is not the program I am looking for as all it does is create a manifest and generate a tar ball.

So like Dist::Maker from the my last post I can rule this one out for my current use.

Enumerations in Moose

It's quite a common pattern in object-oriented programming to have an attribute which takes a string as its value, but which only has a small number of valid values. For example:

 package Shirt;
 use Moose;
 
 # "S", "M", "L", or "XL"
 has size => (is => 'ro', isa => 'Str', required => 1);

This offers no protection against invalid string values.

 # No exception is thrown
 my $shirt = Shirt->new(size => "LX");

Marketing for Perl is easy because Perl is awesome

Liz and I were awarded the White Camel Award last year and are very proud of that. Thank you all. Too much honor, and I feel a bit silly now. No modules on CPAN, not a member of any Perl-organisation, not a single line of code written in the past 9 years, and mainly being silly and loud.

Liz and I went on doing what we like best. Go to Perl-events.

Bangkok.pm 1 meet up short summary and pictures.

Bangkok.pm 1 meet up is now ended. I posted short summary and pictures on: http://oiami.blogspot.com/2014/05/bangkokpm-1-meet-up-has-been-ended.html

Entering MooseX: XX Even more Xes

Well looking at my next victim on the list and so I was going to have a look at Dist::Maker. Well sorry to say this one seems out of the running very early on. As from what I have discovered on its documentation it is really is just for creating distributions from scratch. Pity as I already have most of my dist done so I will just play that I haven't done that part yet and see what I come up with

Well it did install smoothly even though I used a new clean version of Perl it only took a few mins compared to the over 45 for Dist::Zilla on a box that had a good number of prerequisites to begin with.

The Mod itself is sparsely documented but then again it is very simple stuff so that is not too many points off, One thing I did like where the examples that are included as they helped out some what.

GPW2014 & NLPW2014 Survey results

The workshop surveys for the German and Dutch Perl Workshops are now online, and you can see them at the following links:

I'm particularly proud of the Dutch Perl Workshop site, as Theo emailed me just before the event and asked whether it would be possible to have a survey. Within 24 hours, we'd set up the site, and emailed out the first survey links. It's the quickest turn around I've done, and gives me confidence the backend code is as stable as it needs to be for a release.

As such, I'm in the process of tidying up some of the package files, and will be releasing the base site to CPAN soon. I also aim to write a more generic survey creation tool, so that if anyone asks in the future, it will only take an hour or two to set up a site. and get it going.

The hard part is actually finding time afterward to make sure all the text is okay, and no inappropriate comments are made. Thankfully, that is increasing unnecessary, so with the forthcoming YAPCs (NA and Europe), I'm hoping to be able to just press the button and run the scripts to send the emails and create the survey pages.

The more automation the better :)

1. Czech Perl Workshop

As you would expect, it was great on 20.,21. May, so why talk further?

Licenses and the repository links on CPAN (May 2014)

After a few months break, I checked how many CPAN modules provide link to their version control system, how many provide a license in their META file, and how many adhere to the Changes spce.

Entering MooseX, XIX Now We Package II

So in my last post I had started to play about with Dist::Zilla and my initial playing about I was very pleased at what it gave me. Now I did have a few thinks to clean up, some test roles that where throwing some sort of warning when they should not and where I was building the Mod was 100% right.

So the first the extra roles


Warning: prerequisite test_role1 0 not found.
Warning: prerequisite test_role2 0 not found.
Warning: prerequisite test_role3 0 not found.


So having a look at 'Dist::Zilla::Plugin::AutoPrereqs' I see there is a 'skip' attribute for it (with with Dist::Zilla plugins there are custom param you can pass to them from the .ini file.

So all I need is add a quick regex like this to the ini file

[AutoPrereqs]
skip = test_role\d

and then did

dzil build

CPANdeps and cpXXXan scheduled downtime

CPANdeps and cpXXXan will be unavailable for some of the evening of the 28th of May, for a data centre move.

Introspection in Devel::Trepan

Here are some introspection routines in Devel::Trepan. I’m not aware that these exist in other debuggers, nor as Devel::REPL plugins. But if I’m wrong feel free to correct me in comments. And feel free to take code from Devel::Trepan to rework elsewhere.

Recently Jeffrey Ryan Thalhammer asked about variable, and subroutine completion and this got me thinking.

Info functions and Info packages

When he asked, there was a debugger command info functions which listed functions matching some regular expression. (There is also a gdb command of the same name.) That command accepted both fully-qualified and unqualified function names.

It occurred to me that I could also add an adjunct to that command, info packages. This command takes the data used in info functions, but it reindexes the fully-qualified function names keyed by package.

So here are some examples:

Spelunking: why 'while(){ }' is my new favorite perl-ism

Today I saw a post by sartak mentioning a feature I didn't know: while () { ... } is legal and acts as an infinite loop.. This is awesome! I occasionally have need for a while(true) loop, and I like while() better than while(1).

But I couldn't stop there, I had to find out why, and if it's a feature I can count on.

(If you think you'll go cross-eyed looking at parsing details, please still check out the commit message I found at the end, it's a neat bit of history).

Checking the docs

Entering MooseX, XVIII Now We Package

Well starting today to look at Dist::Zilla and as I develop mostly on a Winders box (yes I know I a not a real Perl programmer) I had a look at the Testing Matrix to make sure I can use it and I can. So step two was a doing the install and it does have quite the dependency list and my Perl is quite sparse in terms of installations so it took a good half-hour to install all the needed modules and this is my new super fast 64k super gaming lap top so I would think it is a little slow but it does go in

Now looking at the POD it is very well documented and and it even has its own web site which is quite well laid out and easy toe use.

On Giving Back

A few days ago I published Math::Vector::Real::Farthest, my 100th CPAN module. I got into CPAN in 1999 so it has been a long, mostly quiet, way.

Some modules were a side effect of my paid work, done while contracting or, lately, as a regular employee. But most of them were done on my free time for fun. Just because I had that idea on my head, or because somebody just pushed an interesting problem under my nose (AI::Termites, Algorithm::ClusterPoints, Algorithm::GaussianElimination::GF2), or because I felt I could do something better (Net::OpenSSH, Net::SFTP::Foreign, Sort::Key), or because I needed something to waste my time (Language::Prolog::Yaswi) or because I felt that somebody just have to do it (Math::Int64, Math::Vector::Real, Tie::Array::Packed) or well, whatever.

As such, I never asked to get anything back. Fun was pretty good and enough.

Gittip and companies?

On the main page of Gittip 6 out of the 12 top givers are companies supporting open source. On the main Perl community Page there is no company, and on the extended version of the Perl community Gittip page there is only a single company: Nestoria (currently at position 33-37, giving $1) out of the 42 givers.

I wonder when will companies relying on Perl, come to the conclusion that this is a good and very cheap(!) way to show their support to the Perl community, and probably make it easier for them to hire good developers.

Maybe managers in your company need to be made aware of Gittip and the Perl community there.

Nestoria's Module of the Month

Now this is an idea that I wish more companies would get behind.

Nestoria is a property search engine based in London, but covering several countries (I use them here in France). They're really slick, growing nicely, and their back end is mostly written in Perl. A couple of day's ago they wrote on their blog that Test::More is their module of the month.

Why is this cool? Because this is going to be a regular feature and they're going to start donating a $1 a week (via gittip) to the author or a prime contributor of whatever project they've selected. I would love to see companies financially backing open source products they benefit from. I see plenty of companies are signing up for gittip for this very purpose.

To Nestoria: many kudos for finding yet another way to give back (they also sponsor Perl events and release open source code).

To everyone else: go sign up for your gittip account if you haven't already.

And ask your company to think about gittip and maybe giving back to those who've helped them. I suspect many companies wouldn't find $1 a week to be a burden, though they can certainly pay more if they wish.

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.