The perversity of traditional Perl 5 dereferencing syntax

I wrote this article almost a year ago as part of an omnibus reply to a bunch of different posts from a perl5-porters thread. I never finished all parts of the reply and thus never sent this part either, but in contrast to the other parts of this stillborn mail, I think this one is worth reading. So asked Johan Vromans:

It still escapes me why @* was chosen instead of the much more logical []:

$h{a}[0]->[]

The reason is that there are a number of problems to solve with any new deref syntax:

Non-blocking Mojolicious apps are even easier now!

Hopefully by now you have seen that Mojolicious is a great way to build your non-blocking web (or even non-web) application. Mojolicious come with all kinds of non-blocking functionality out of the box. For more about that see my blog series on the topic. This post is an aside to show you the cool things happening in Mojolicious lately designed to make writing non-blocking apps easier.

Mojolicious is known for fast development and clean APIs. Mojo was that child with lots of excitement and energy, doing new and cool things, providing new and cool functionality, and yes, changing its mind on occasion. But Mojo is growing up and settling down a little bit. It recently went to its first conference and professional training. And it’s starting a family too!

Mojo is starting to feel more grown up, and grown-ups have responsibilities. To borrow one of Perl’s catch phrases, this more mature Mojo knows that it is not good enough anymore to just make things possible, it’s time to make them easy.

Perl Training and donation to TPF

Just a few hours ago Dan Wright mentioned that the Perl 5 Core Maintenance Fund of the The Perl Foundation needs donations. (In addition Makoto Nozaki just mentioned that the budget of the grants committee is only $16,000 for 2014.) Let me offer part of my work as a donation. The deal is that if you organize a Perl Training that I teach, I'll transfer half of the profit to The Perl Foundation. I think it is a 5 x win situation.

  • You win because you get a good training course.
  • Your company that pays the bills wins, because they get a better trained employee.
  • TPF wins because it gets donations.
  • The Perl Community wins by the grants.
  • I win because I can teach and earn some money with something I like to do.
I have the following courses:
  • Beginner Perl
  • Advanced Perl including Moo and Moose
  • Test Automation using Perl
  • Modern Web development with HTML5/CSS3/JS and Perl Dancer

These are all 4-5 days long courses filled with hands-on exercises.

If you'd like to hear more details, please send me an e-mail to gabor@szabgab.com.

Because Sometimes Lightspeed is Too Slow

Spaceballs: Lightspeed is too slow. We'll have to go right to ludicrous speed.

I've pushed Type::Tiny 0.045_03 to CPAN this afternoon. Initial results from CPAN testers seem promising, but if you've got a distribution that uses Type::Tiny it might be worth trying it out with the new version to see if anything breaks. (I don't think anything should!)

The big change in this release is that it adds support for an optional XS backend, which massively boosts the speed of many type constraint checks — especially parameterized types like ArrayRef[InstanceOf["HTTP::Response"]]. The XS backend is a fork of Mouse's type constraints, and needs to be installed separately. It's called Type::Tiny::XS. (OK; not a very creative name.)

Finding unused variables in your Template stash

Quite often companies who use Catalyst (with Template Toolkit) find that after a while, they're over relying on the use of the stash as a global dumping ground. To deal with that, I wrote a highly experimental module to print out unused template variables.

Some statistics from Debian package tags

I'm running Debian Stable (7.x, Wheezy, 7.4 to be exact) on amd64.

Count all Debian packages by their implementation language (I know, not the most efficient way):

% ( for tag in `debtags tagcat | grep '^Tag: implemented-in::' | sed 's/^Tag: //'`; do
    echo -e `debtags search $tag | wc -l` "\t" $tag
  done ) | sort -nr
4439     implemented-in::c
3258     implemented-in::perl
1840     implemented-in::c++
1063     implemented-in::python
304      implemented-in::java
289      implemented-in::ruby
214      implemented-in::ocaml
199      implemented-in::lisp
194      implemented-in::shell
137      implemented-in::php
118      implemented-in::TODO
97       implemented-in::r
92       implemented-in::haskell
79       implemented-in::c-sharp
62       implemented-in::objc
55       implemented-in::tcl
47       implemented-in::fortran
41       implemented-in::vala
41       implemented-in::scheme
37       implemented-in::lua
30       implemented-in::ecmascript
28       implemented-in::ada
2        implemented-in::ml
0        implemented-in::pike
0        implemented-in::erlang

I wonder why no Go yet...

Let's exclude all Perl libraries (/^lib.+perl$/) from that Perl count:

P5CMF Needs some love

The Perl 5 Core Maintenance Fund was initially announce at YAPC::NA in 2011. Since then, it has been TPF's most successful grant program, awarding over $260,000 in grants for continued development and debugging of the Perl 5 core.

Unfortunately, most of the funds have now been depleted. Our four present grantees, Tony Cook, Paul Johnson, Dave Mitchell, and Jess Robinson are each running on allocations that have between 3 and 6 months remaining. Without further contributions to the fund, there will not be enough money to renew their grants.

If you value the work that these people are doing for the Perl 5 Core, please consider making a contribution to the P5CMF by visiting donate.perlfoundation.org soon.

Benchmarking several ASCII-table-generator modules

UPDATE #1 2014-07-11: Added Catmandu::Exporter::Table. This module is not exactly lightweight, so I will not consider it for usage in Perinci::CmdLine::Lite, but it's interesting to benchmark anyway.

UPDATE #2 2014-07-11: Nudged by me, Jakob extracted the table-generating
functionality of Catmandu::Exporter::Table into its own module Text::MarkdownTable. This module depends on nothing but Moo. Great job Jakob. Although for my particular project Perinci::CmdLine::Lite, I declared that Moo is a bit too heavy, and so excluded it. :)

UPDATE #3 2014-07-11: Added more modules to the mix: Text::FormatTable, Text::Table::Tiny. Excluded more modules: Data::ShowTable, Text::UnicodeBox::Table.

UPDATE #4 2014-07-11: Excluded 2 more modules: Table::Simple, Text::SimpleTable::AutoWidth

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 run by Dave Cross and Aaron Crane, with a design donated by Six Apart, Ltd.