Avoid a Common Software Bug By Using Perl 6

Back in 2001 I was working for a company who had a client who was in a serious bind: the maker of their point of sale (POS) system suddenly jacked up the license fee to the point where our client would go out of business. They needed a new POS in 21 days.

We grabbed an open source POS system and identified all of the features it was missing that our client would need. Then it was 21 days of overtime and no days off. Back in the days of use.perl.org, I blogged about this hell almost every day. It was also, interestingly, the first project I wrote software tests for. The other main dev on the project was teaching me how Perl's testing tools worked and as the days went on, I found myself incredibly proud of seeing all of those tests pass and catching bugs I would not have otherwise caught.

CPAN to MetaCPAN auto redirect for Chrome released

Like most of you, I prefer MetaCPAN over CPAN. The biggest issue I had was any google search and older blog posts all linked directly to CPAN.

I found 'MetaCPAN Helper' on the Chrome Web Store however using it caused google to pop up a page about me being redirected whenever I clicked on a CPAN link costing me a few extra seconds to get where I wanted to go. Like many of you I thought this was unacceptable so a little while back I created my own extension that does not have this issue.

What the extension does is rewrite all search.cpan.org url's to search.mcpan.org without any tracking, annoying popups, or redirect pages.

Hopefully this will help some of you out. If you have any issues or features you would like to add you can do so at: https://github.com/bvierra/chrome-metacpanredirect/issues or send me a pull request.

Source Code is available at: https://github.com/bvierra/chrome-metacpanredirect

Extension is available at: https://chrome.google.com/webstore/detail/meta-cpan-redirect/blakeebdldmplhhegjofiaidnijmiphj

How do you join the conversation?

blogs.perl.org is great in that it's a stream of blog posts around a specific technology. Since I, like many of you, blog about other technologies too, I'd like to learn from you about other conversation streams. For me personally, the list of topics include:

  • Web development (JavaScript, CSS, etc)
  • Lifehacks
  • Unix, Linux, shell scripting
  • General tech / tech business
  • Database

I'll add what little knowledge I have on the topic:

More

Removing AUTOLOAD from CGI.pm

I'm about to release an update to CGI.pm that will strip out all of the AUTOLOAD and deferred compile optimization. I'm reasonably confident that this will have no impact other than adding a few tens of milliseconds to the startup time for any scripts using CGI.pm. Of note is that CGI::Pretty will now be deprecated, along with the -complile pragma and ->compile method. If you are using the -any pragma and have arbitrary tags (or typo's) in your code then your code *is* likely to break.

This optimization was added twenty years ago, it has little to no benefit now and makes the code difficult to deal with as well as falsifying test coverage metrics. It needs to go. Given the legacy sprawl of CGI.pm there may be bugs lurking; if you're using CGI.pm please test this release. The DEV release is available on CPAN:

https://metacpan.org/release/LEEJO/CGI-4.13_02

RFC: Limiting grant duration

I am thinking about adding this to the grants operation rules:

If the grant does not finish within three times of the proposed duration or within two years, the grant will be considered a failure.

First of all, it should be noted that it won't affect most grants (see the reason 2).

Reason 1: Budget structure & allocation to new grants

TPF does not allow over-allocation of the budget. If we have 3 x $3,000 grants running and our budget is $9,000, no more grants can be funded.

If a grant worth $3,000 is running for five years, this $3,000 is stuck in the TPF safe. Even if we get good proposal, we cannot fund it using this money.

The aim is to increase liquidity of the fund.

Reason 2: If a grant runs more than a year, chance of failure increases

During 2009-2013, we managed 17 grants. Here is the breakdown:

CPAN.io, yearly boards and gamification

The CPAN once-a-week has been running for more than three years now, with several active leaderboards. NEILB introduced the monthly and daily releases competitions, and the notion of NeoCPANisms. CPAN.io extended the game to seven different contests, over more release types and periodicities.

Note: The CPAN.io Pulse also has [a post about what follows]((http://cpan.io/pulse/2015/02/new-cpan-board-and-all-yearly-boards.html).

Analysing CPAN Testers' Reports

The task

In the second round of the Pull Request Challenge, I was assigned Olson::Abbreviations. At work, we've been bitten by the ambiguity of the EST timezone, so I liked the general idea of the module. Moreover, there were some test failures reported at CPAN Testers Reports, so the task was clear: Make all the tests pass!

Always make_immutable (unless you have a very good reason not to)

One hears that __PACKAGE__->meta->make_immutable is a must all your Moose classes. ( edit, ht ribusushi: never immutate your moo classes, it'll inflate them into Moose classes automatically thus defeating the point). Here's a stark reminder of why.

I was doing some benchmarks on a web application that I've been moving from mod_perl to plack. Here's the performance of 350 requests forking off in batches of 7 before I remembered to make_immutable:

$ time perl 002-hammer_lightly.t 
# Total number of requests = 350
real    1m11.095s
user    0m3.003s
sys 0m1.336s

And after:

Looking for YAPC::NA News?

It is very frustrating when there is a conference you want to attend and you can't get any information about it. It is even more frustrating when you are a conference organizer receiving complaints about no news despite all your efforts to keep people informed. Here is a guide to finding out what's going on inside YAPC.

Starting with the official channels:

The first and foremost way to find out what's happening with YAPC is yapcna.org. The home page of the conference site contains a news banner that will take you to recent announcements. It also has a list of links to places you might want to subscribe to receive information.

But wait, there's more...

New Djet blog entry

Moved to a new blog

Using Perl Dancer and Docker to create simple monitoring system

I needed a simple system to monitor events. I wanted to have a system where I can specify that object with some name is 'ok' or 'fail'. And I wanted the system to be able to expire statuses. In case there is no data for the object for a long time then the status should be automaticly changed to 'unknown' — to handle situations when script that sends data breaks.

I looked for several systems, but none suited me well, so I've written my own very simple solution with the name 'curry' (it is named after delicious indian dish, not after Haskell Curry =)

Here is the source code — https://github.com/bessarabov/curry

The system is a web server that is powered by Dancer and the system is bundled into an image with Docker.

I really like this way of creating web apps with Dancer & Docker. Every time there is a new commit in git report Docker Hub automatically builds new image.

Today’s bit of black perl

use 5.010;
{
    package F;
    sub new { bless {}, shift }
    sub me { $_[0] = 'surprise!' }
}
my $f = F->new;
say $f;
$f->me;
say $f;

Output:

F=HASH(0x7f9daa025c80)
surprise!

Teehee…

Deployable

I just wrote about a program I crafted some time ago... in Perl. Happy reading if you're interested into producing smarter tarballs! The article is here.

Hacked Again?

I was just alerted by haveibeenpwned.com that my email address was leaked, and the link given was this:
https://www.quickleak.org/QtPly6aE. "Islamic Cyber Resistance Hacked blogs.perl.org to Show Support Syrian People And SEA". I can't say I follow their logic, but there's a database dump there.

Fun with overload

Spoiler alert: If you are participating in the DFW.pm February thought exercise, this post is about my solution :)

DFW.pm challenged its members with the following exercise:

Pivot a multi-row/multi-column table, 4X4 in size for example, containing name-value pairs. Code should account for larger table sizes with any number of name-value pairs. Numbering the pairs is optional but encouraged for readability. An example would be as follows:

Short survey of modules for combinations and permutations

This is a short look at some modules for generating combinations and permutations. There are likely more modules that aren't listed. RosettaCode has examples of writing the combinations and permutations functions by hand.

Combinations and Permutations
Module Impl Comb Perm Comb w/rep Perm w/rep Derange Speed Order Comments
Algorithm::Combinatorics XS yes yes yes yes yes + Lexico Fast iterator or array
ntheory XS yes yes no no no ++ Lexico Fast block call
Math::Combinatorics Perl yes yes no no yes - - Impl Iterator or array
Algorithm::FastPermute XS no yes no no no +++ Impl Fast block call
Algorithm::Permute XS no yes no no no + Impl Iterator or fast block call
Algorithm::Loops Perl no yes no no no + Impl Iterator
List::Permutor Perl no yes no no no - Lexico Iterator
Iterator::Misc Perl no yes no no no - - Lexico Iterator
Math::Permute::Array Perl no yes no no no - - Impl Iterator or index
Math::Permute::List Perl no yes no no no Impl Block call
Math::GSL::Permutation XS no yes no no no - Lexico function interface
Math::Disarrange::List Perl no no no no yes Impl Block call
Math::GSL::Combination XS yes no no no no + Lexico iterator or by index

Mojolicious Triumphs Over Legacy Code

I got a text at 8:00am:

"Hey, can you jump on a conference call?"

Groggy and disoriented, I blearily type the conference line and enter my passcode, followed by the pound or hash sign. At the tone, I would be the 6th person to enter the conference. Tone.

"The app is down, and trading has stopped."

GSoC: I need your ideas


As I mentioned in my last blog post it would be really great if we were to get into the Google Summer of Code for 2015. We had an extremely succesful 2014 and being a part of this event again would be good for the community and for Perl.

However to do that we need a stack of ideas of projects, modlues or code for the students to look at and then choose. We need mentors to volunteer and we need people looking for students. We have a week to really flesh out the ideas page.

Currently the ideas are on a wiki and you need to contact myself or Paul Johnson to be added as an editor. However if that seems to onerous, you can just add them to this Google Doc which has been set to freely edit.

So I need your help, I need people with ideas or plans to help improve Perl, a Perl project or library, a documentation project, or build a whole website for a project, tackle some fun features. Which means I need you.

Please spread the word, join the mailing list and get involved.

-mdk

GFU Cyrus AG is sponsoring the QA Hackathon

We’re happy to announce that GFU Cyrus AG will sponsor the Perl QA Hackathon 2015.

Originally founded as GFU Cyrus + Rölke mbH in 1980, GFU Cyrus AG is now one of the best-known IT training companies in Germany.
Several thousand IT specialists from all over the Federal Republic of Germany visit seminars at GFU every year. The program includes more than 1000 different seminars.

STRATO is sponsoring the QA Hackathon

We're happy to announce that STRATO has decided to sponsor this year's QA Hackathon.

If you live in certain parts of Europe then you will probably have heard of STRATO, but others might not. STRATO is an ISO 27001-certified hosting provider with its headquarters in Germany. STRATO offers domains, email and homepage packages, online storage, web shops and servers through to high-end solutions.

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.