A Perl Classic

Well if you have been working with Perl long enough you are more than likely to have run into the situation where you are playing with a code base that is shall we say a little dated.

Of course being a good modern Perl programmer you will want to take advantage object-oriented programing or newer version of modules that do more but need a more modern Perl.

Sometime you are stuck in one version of Perl and are forced to write some of you own modules like my Orignal which gave me rather simple attributes when faced with Perl 5.6 for a large project.

Well sometimes the opposite is true you do get the chance to upgrade your Perl and suddenly things stop to work so there can be just as many problems with upgrading and this is what I am blogging on tonight.

GPW2014 - day 2

This morning startet with a debugging session. Denis Banovic demonstrated the elegance and ease in which Devel::hdb can get used to debug a running app inside a browser.

The next two talks were held by Ralf Peine who showed his Perl Open Report Framework. In his first talk he demonstrated the typical usage for generating reports from possible huge amounts of data. The framework consists of several decoupled parts getting coordinated by a mediator. In his next talk he mentioned many patterns and idioms he used inside his software.

Jürgen Peters demonstrated some Haskel features by live hacking a couple of functions doing recursive or list-prcessing work. He raised errors by mis-typing types for demonstrating the type-checking capabilities of the Haskel compiler. His conclusion was that compile-time checking is of high value which lives in contrast to the dynamic nature of Perl.

Resolving gitolite's "remote: FATAL: fingerprinting failed for 'keydir/some_user.pub'"

Digging about in the gitolite code reveals this error is thrown when a regex fails to find a valid looking fingerprint after running ssh-keygen -l -f 'path/to/key.pub'. (See man ssh-keygen for details).

To resolve the issue, run that command locally and have it generate a valid fingerprint before you push your configuration changes to the gitolite server. I found my issue was that I had failed to include the 'ssh-rsa ' prefix to the key.

I also saw comments suggesting this issue was related to key size. I saw successful tests using the '-b 1024' and the '-b 2048' switches, so I have serious doubts that the key-size theory holds water. It does not seem supported by a code review of the complaining function.

I seem to encounter this error every few months. It looks familiar to me. Hopefully this blog post might get indexed by the search engines and I will be saved the lost time researching this question yet again, or if noy me, then perhaps others.

-- Hugh

RSS feed for blogs.perl.org

Wondering if there is an RSS feed for all new entries on blogs.perl.org.

Is that Meta Moose or Moose Meta?

I had an interesting discussion to day with a programming friend of mine and we got onto to topic of metadata and as the last few posts I have made have been using metadata (or at least I hope I was)

My friend comes from a DB background so to him metadata was is and ever shall be just data that describes data, You know what I mean the indexes, fields, types tables ect all the annoying minutia of programming. I of course come at it in a different manner I see it as more of a guide to understanding the data.

Well we both agreed it is at some wishy washy mid point that these two meet and become useful, Our conflict arose because after seeing my last post he mentioned some other code of mine we where working on that use a 'role' to apply meta data to an object something like this

GPW2014 - REST workshop

On the first day of the German Perl Workshop I was attending a workshop held by Lars Dɪᴇᴄᴋᴏᴡ 迪拉斯 (daxim) from Vienna.PM. Based on code taken from a real world application he showed us how to implement a modern REST Architecture that goes far beyond the otherwise seen and mostly unusable demo programs.

The Infrastructure Layer of his architecture is a DBIx::Class driven Schema model containing all entities which are later made accessable by the REST API.

The Application Layer is based on Catalyst and uses some very clever tricks for dispatching incoming requests to the right action methods that care about the various use cases (think: HTTP Verbs).

He used a couple of supporting modules like Data::HAL for generating standards-complient HAL easily. HAL offers a set of conventions to provide hyperlinks in JSON. Furthermore, syntactical and semantical validation is done using a subclass of JSON::Tiny::Subclassable and JE evaluating a prepared javascript due to the lack of a Perl implementation currently.

QA Hackathon 2014 in Lyon

It was awesome. Thanks so much to all who made this possible: Laurent Boivin, Book, Wendy, all the sponsors (https://perltoolchainsummit.org/qa2014/sponsors.html : Booking.com, Splio, Perl6, ELIGO, Grant Street Group, Dyn, EVOZON, Campus Explorer, elasticsearch, Mongueurs de Perl), and all participants: you were great, you are great.

As has been noted, the value of the get together often is the groundwork for lifting new ideas off the ground. And so it was for me, too:

Talk with Christian Walde, Slaven Rezic and David Golden about a test module to be written that would become a generally applicable reporting module on all relevant modules for a given distribution. It would read all declared dependencies, recommendations and suggestions of said module from the MYMETA.yaml, load them all into one process and then dump the currently installed versions of everything found in %INC.

Make Your Live Demo Flawless!

In the last few years I've given several presentations on Pinto. I usually start with a deck of slides and then finish with a live demonstration.

We all know the hazards of doing a live demonstration. And with command-line tools, there is the added risk of annoying the audience while you stumble around the keyboard.

I wanted to make all that go away. So I created App::Cleo. It includes the cleo utility which runs pre-recorded commands interactively. You can step through each command simply by pressing the space bar. So no more typos!

Sometimes, you want to stop and explain something in the middle of the command. For that, you can put breakpoints inside your commands. And when things go wrong, you can redo the current or previous command by pressing r or p respectively.

You can see cleo in action in this video (the live demonstration starts around 10:47).

PS: It wouldn't surprise me if there is already some kind of tool for this. If you know what it is, please enlighten me.

Do Even more with Meta (Yet Another Moose Meta Trick IV)

Well in my last post I left of with my serializer working for boolean and json and recursing down into itself to work for objects, well one object anyway, and I left it at that with the gaping hole in my code if I need to look at any deeper objects.

Well I am in luck again as 'MooseX::MetaDescription' not only works for 'Attributes' It can also be applied at the 'Class' level.

It is a little more complected than just adding a 'trait' to an attribute or a class as one has to create a base class first and in my case it was like this

An Organization for Alien::Base

Alien::Base is a system that simplifies writing Alien modules to provide external libraries via CPAN. When I first wrote it, I knew that it was going to be a useful project, and I feel even more strongly about that now.

That said, I feel that I have taken Alien::Base as far as I can on my own.

Several others have offered good and useful suggestions and even patches which have unfortunately languished as I attempted to find time to consider their utility or when my knowledge of the situation was lacking. I have therefore decided to expand the circle to include a few of these contributors. I will remain on the team, where I will attempt to guide (not dictate) the project to continue along the path that I still envision for this work.

Perl5-Alien is a development organization devoted to the continued development of Alien::Base and the Perl 5 Alien ecosystem as a whole.

I hope that this will be a step in the right direction for the Alien ecosystem.

If you would like to submit your name for consideration to join the team, please contact me either on this post, via irc, or email. Of course everyone is welcome to contribute via pull requests or by writing your own Alien module for your favorite external library.

QA Hackathon 2014 and CPANTS

I mostly worked on CPANTS at the QA Hackathon in Lyon, as I did in the previous years.

As one of the significant topics of the hackathon was PAUSE permissions, I started to add PAUSE permissions handling to the CPANTS analyzer (thanks to Ricardo Signes), and introduced a "no_unauthorized_packages" metric as an extra one. Because the PAUSE permissions index hasn't kept the date/time when one got or lost the permissions, this metric may return a different result from search.cpan.org in a rare case when a person who had necessary permissions and successfully released a distribution eventually lost the permissions. More fixes on permissions to come later.

I also started investigation required to implement a few more metrics/features including "has_abstract_in_pod" (which Neil Bowers explained me at the hackathon, and kindly gave me a code). I'm hoping I can bring some out by the next month (I haven't released a newer version of Module::CPANTS::Analyse yet, hoping to include these).

Perl QA Hackathon 2014 report

Last week, I travelled to Lyon, France for my first QA Hackathon . Although it is even longer than a YAPC (four full days rather than three), there were no formal talks, no job fair... just thirty Perl programmers put together in a few rooms to work on problems together and improve the Perl ecosystem. I felt very privileged to have been invited, and came ready with a list of projects, problems, and topics of conversation.

Do More With Recusion (Yet Another Moose Meta Trick)

So I am happily programming along with my nice shiny new 'Serializer' sub that I have cobbled together over the last few post and it is now looking something like this

Which modules do you use?

I submitted a grant request to The Perl Foundation to make the generation of a "batteries included" Perl distribution for Windows and Linux smooth.

Most of the commenters liked the idea, but found the money I asked for too much. So I don't have high hopes in receiving the grant, but one of the points was to do a "market research" or a "survey" to find out which modules people use in their applications. Basically mapping part of the GreyPAN or DarkPAN to see which CPAN modules are in use and which modules should be included in such a "batteries included" distribution.

This information would be useful even if I don't get the grant. So let me ask you, which CPAN modules are in use in your applications? I am interested both in open source applications and ones that are proprietary. Just give me a list of prerequisites.
Please do it even if you don't use DWIM Perl and don't plan to switch to it. Others might find it useful to have a Perl distribution containing those modules.

Oh and if you don't want to publish the list here, then you are welcome to send them by e-mail to me: szabgab@gmail.com

Inheritance is Bad: Code Reuse Part I

0. Overview

  1. Inheritance is Bad: Code Reuse Part I
  2. Inheritance is Bad: Code Reuse Part II
  3. Inheritance is Bad: Code Reuse Part III

1. Introduction

A little time ago i commented on a blog on this site and gave an description about why Roles are better than inheritance. Or better, why i think so. That was how some people interpreted my comment, but my comment was more about "Inheritance sucks". I talked about Roles because it was the topic. So now i decided to do a series of "Inheritance is Bad". And i want to give different reasons and description for it, why i think this way. But only complaining isn't so much productive, so i also want to give examples what you can do, to make it better.

2. Code Reuse

The Perl QA Hackathon 2014 in Lyon is over

(A shorter version of this post has been sent as a thank-you email to our sponsors.)

The Perl QA Hackathon in Lyon has ended last Sunday. According to the participants, it was a great success. They know, as well as the organisers, that we could never have made it without the support of our sponsors. We would like to thank them again for their help. Perl and CPAN come out better and stronger of these four days of hacking and talking.

Tina Müller is organising the next edition of the Perl QA Hackathon in Berlin in 2015. We hope she and our sponsors will be in touch in the future. :-) And also that this post will inspire new sponsors to support an event that has become a yearly milestone for Perl and CPAN.

Rather than badly paraphrasing what the participants had to say, I'll simply pass only some significant quotes from their blogs, on the topics that are relevant to sponsors past and future.

YALMT (Yet Another Little Moose Trick)

You might of read my last post where I solved a problems with serializing an object to JSON by using 'MooseX::MetaDescription' well go a little deeper into coding today and then ran into this;


 has 'spell_use' =>(
	is		=>'ro',
	isa		=>'Bool',
        default      =>0,
);

and then this gets turned into JSON with JSON::to_json I get this;


    {"spell_use":0}

GPW2014 - Afternoon talks

During the afternoon we had a couple of interesting talks.

Steffen Winker talked about Testing binary data. He mentioned several distributions being capable of generating useful messages in case of test failures. It turns out that only meaningful messages enable the developer to quickly be able to react to failing tests. All of the four candidates Test::BinaryData, Test::Bits, Test::HexString or Test::HexDifferences are doing a good job and it is merely a matter of taste or the amount of binary data which one to use.

The Twelve-Factor App

The Twelve-Factor App :

12 factor is an interesting way to think about medium to large scale app development. I don’t use or agree with all of the ideas here, but at the very least this is a great starting point for developing your own methodologies. 

[From my blog.]

Thank you for all public comments

In this round, The Grants Committee has received four grant proposals (list).

Since we posted them in public, we have received a number of public comments. At this point, here is the number of comments at the TPF site:

  • 6: Automated generation of DWIM Perl
  • 9: Perl::Lint - Yet Another Static Analyzer for Perl5
  • 12: RPerl Test Suite Upgrade & Module::Compile Integration
  • 10: JERL (Alien::Jerl) Perl5 running in the JVM

This includes the comments from the applicants.

The number of comments is one way to measure feedback but quality of the comments is more important. And most comments, if not all, were constructive and in great quality.

Thank you for those who spent time to give feedback.

We will conclude the voting process in one week.

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.