Tweets and retweets from Week #43

This is my second attempt of trying to get into a habit of blogging on a more regular basis. The blog posts categorized as Retweets will list a set of tweets and retweets from the week just gone by.

David Golden (@xdg) wrote a very interesting blog post very relevant to my own issues with keeping up with and consuming and publishing via social media. I decided to tweet this since David’s pragmatic approach and reflection are very interesting especially if you want to work smarter and not harder with your social media interaction.

Putting social media on cruise-control – interesting blog post by @xdg, approaching social media with pragmatism

Smashing Magazine (@smashingmag) featured an interesting and insightful article on coding standards. The article is written by Nicholas C. Zakas (@slicknet). The article is mentions Javascript and CSS as examples, but the issue is universal and some good guidance it given to thinking about and shaping your own coding standard for your situation and languages.

Better Code Quality: Why Coding Style Matters, great piece on importance of coding style via @smashingmag by @slicknet

ack is a fantastic command line tool, which I often use over grep. Check it out, you will not be disappointed.

@lbalker: @drkrab @mtnygard it’s spelled ack ( ). You’re welcome 🙂

I love figures and diagrams, so this article caught my eye. Nice diagrams and a very interesting topic, which I need to read up on by the way. The concept of message queuing is quite intriguing and the article provides a good introduction to AMQP.

@kellabyte: Blogged: Clarifying AMQP

Keep (re)tweeting,


Tweets and retweets from Week #43

Nordic Perl Workshop 2012

Just back from the Nordic Perl Workshop 2012 in Stockholm, Sweden.

It has been quite some time since I have attended a Perl community event, so it felt awesome to see old friends again and at the same time meeting new people.

The Nordic Perl Workshop 2012 was arranged by Claes Jakobsson, who always set up a nice 1 track setting, so you do not have the dilemma of choosing between tracks. You can settle in one room and you are then exposed to talks you might would have skipped, a very elegant way to arrange a workshop in my opinion.

The Nordic Perl Workshops in Stockholm have always been my favorites since the atmosphere is very intimate and by the end of the workshop you end up have talked to practically all attendees.

The 2012 workshop was no disappointment, the program was varied, with different speakers covering a wide variation of topics.

– Jonathan Worthington on Perl 6 modules and
– Claes on Perl 5 topics related to parsing and debugging
– Salve Nilson on communities
– Ulrich Wisser on Perl::Critic and a very interesting talk on SASL and related
– Me on Stackato
– And of course Damian Conway on Perl 5 regular expressions and most impressive regular expression debugger: Regexp::Debugger

Unfortunately I had to leave prior to hearing the last talks and I am sure I missed out on some good talks, but a national holiday back home in Denmark required my presence for a family holiday.

In addition to the marvelous talks I had great conversations with other attendees on topics like SOA architecture, Perl culture and on software development methodology and practices. The workshop was compact, but as always immensely educational and fun.

We are considering having the Nordic Perl Workshop 2013 in Copenhagen – I hope we will be able to do just as good a job as Claes and the Stockholm Perl Mongers (sorry Salve Meetup).

Nordic Perl Workshop 2012

Textmate and Perlbrew

Textmate is a marvelous text editor for programming and other text based tasks on OSX. It even has a great extension for assisting when programming Perl. One of the really helpful features is a syntax validation happening when a file is saved.

Take for example this incomplete Perl source file below

If you specify the contents as perl (see the bottom of the window) or let Textmate resolve this Textmate will evaluate the contents when I save and get an error due to the very obvious syntax error in line 3.

Correcting the contents of the file, will give me status indicating an evaluation success.


This is really nifty most of the time, but I ran into a problem.

I am using App::perlbrew (perlbrew) to handle my local Perl installations. Perlbrew is a magnificent tool and it lets me install several different Perl interpreters in parallel. So I can evaluate my code using different versions of Perl.

The check executed by Textmate is handled by a script named: (available on Github) and it relies solely on the system perl installed in /usr/bin.

So when I work on a project requiring a newer (or older) version and I then use Perlbrew to satisfy this, I have to install external dependencies with two Perls – not exactly optimal also because I am not interested in maintaining and feeding all sort of crazy modules to my system Perl, just because I am working on some project.

Luckily adjusting to recognize and use perlbrew is quite easy.

perlbrew sets some environment variables when active:


When perlbrew is active these variables will have content, if not or not installed, existing behavior should be preserved – and not everyone uses perlbrew.

So if PERLBREW_PERL is defined we have a Perl interpreter controlled by perlbrew and we can adjust accordingly. See lines 34 to 42. So We define our Perl interpreter to point to this instead of the Perl interpreter located in /usr/bin.

[codesyntax lang=“perl”]

use strict;

# cwd should be $™_DIRECTORY
# filename to check is $ARGV[0]

my $file = $ARGV[0];

my %file_source;
sub read_source {
require File::Spec;
require File::Basename;
my $file = shift;
my $file_source;
{ local $/ = undef; open F, “<$ENV{™_FILEPATH}”; $file_source = <F>; close F }
my @file_source = split /\r?\n/, $file_source;
my $path = $file;
if (!-f $path || !File::Spec->file_name_is_absolute($path)) {
$path = File::Spec->rel2abs($path, $ENV{™_DIRECTORY});
if (!-e $path) {
$path = undef;
my $base = File::Basename::basename($path);
foreach (@INC) {
my $file = File::Spec->catfile($_, $base);
$path = $file, last if -e $file;
$file_source{$file} = { source => \@file_source, path => $path };

my $perl;

$perl = “$PERLBREW_ROOT/perls/$PERLBREW_PERL/bin/perl”;
} else {
$perl = ‘perl’;

my @lines = `”$perl” -Tcw “$file” 2>&1`;
my $lines = join ‘’, @lines;

if ((scalar(@lines) == 1) && ($lines =~ m/ syntax OK$/s)) {
exit 0;

$lines =~ s/&/&/g;
$lines =~ s/</</g;
$lines =~ s/>/>/g;

# link line numbers to source
$lines =~ s%^((?:.+)[ ]+at[ ]+(.+)[ ]+line[ ]+)(\d+)[.,]%
my $pre = $1;
my $file = $2;
my $lnum = $3;
my $col;
if ($pre =~ m/“([^”]+)”/) {
unless exists $file_source{$file};
my $source_line = $file_source{$file}{source}[$lnum-1];
$file = $file_source{$file}{path};
$col = index($source_line, $1);
$col = $col != -1 ? $col + 1 : 0;
} else {
if ($file !~ m!^/!) {
unless exists $file_source{$file};
$file = $file_source{$file}{path};
my $url = qq{txmt://open?url=file://$file&line=$lnum};
$url .= “&column=$col” if $col;
qq{$pre<a href=“$url”>$lnum</a>.};

my $output = ‘<pre style=“word-wrap: break-word;”>’;
$output .= $lines;
$output .= ‘</pre>’;

print $output;

To make a point on my opinion on the use of system perl. You can have a look at the script above. This script is an external application, bundled with Textmate and therefor it relies on the presence of perl in /usr/bin in order to work, so this line is perfectly okay and it should work even though the operating system is updated.

If you read the script carefully you can see that the script uses two external components:

  • File::Spec
  • File::Basename::basename

These are Perl core modules and they should not give any problems. But if you by some weird coincidence and accidentally change or break these as part of development, you are breaking your toolchain at the same time. Your system perl should be considered a key component in your operating system on most modern operating systems.

Textmate and Perlbrew