Granada Perl Workshop

Less than three weeks remain for the Granada Perl Workshop that will take place on the Friday 27th of June in Granada (Spain).

The good news is that, thanks to our sponsors, finally, the event will be completely free.

Even if the workshop is a one-day event, most of the attendes are going to stay there for the full week-end in order to visit the beautiful city, socialize, and have long conversations about Perl, and well, probably anything.

So, you are still on time …

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, ="https://metacpan.org/pod/Algorith…

Finding my computer

A couple of days ago I replaced my computer at work with a new one. This morning, working from home, when I tried to log in, it didn't respond.

I realized promptly that I had forgotten to ask the sys admin to update the MAC address on the DHCP server and so it just got some random IP from the pool.

Perl 5, Perl 6, Perl 7, Perl 2013, whatever

It seems people outside our community sees Perl as an stalled language because we have not released a new mayor version for so many years. We have to do something to show them they are wrong, right?

Well, no, maybe the problem is ours, unable to see what we don't want to see: They are right. Perl 5 is stalled.

Stevan Little has already described the situation quite well on Perl is not dead, it is a dead end. The funny thing is that it is mostly the ="http://www.perl.com/pub/2000/10/23/…

Solving Carl Mäsak's "Counting t4 configurations" problem... in pure Perl 5

The problem: Counting t4 configurations

The solution:

$ time perl t4.pl 
total: 4783154184978

real    0m0.185s
user    0m0.176s
sys     0m0.004s

The code:

#!/usr/bin/perl

use strict;
use warnings;

my $tab = <<EOT;
-----xxx
------xx
x-----xx
x------x
xx-----x
xx------
xxx-----
EOT

my $vertical = index $tab, "\n";
my $diagonal = $vertical + 1;

my $acu = { $tab => 1 };

for my $ix (0 .. length($tab) - 1) {
    my %next;
    while (my ($k, $c) = each %$acu) {
        my $s = substr($k, 0, 1, '');
        $next{$k} += $c;
        if ($s eq '-') {
            my $k1 = $k;
            if ($k1 =~ s/^-/x/) { # horizontal xx
                $next{$k1} += $c;
                if ($k1 =~ s/^x-/xx/) { # horizontal xxx
                    $next{$k1} += $c;
                }
            }
            $k1 = $k;
            if ($k1 =~ s/^(.{$vertical})-/${1}x/os) { # vertical xx
                $next{$k1} += $c;
                if ($k1 =~ s/^(.{$vertical}x.{$vertical})-/${1}x/os) {  # vertical xxx
                    $next{$k1} += $c;
                }
            }
            $k1 = $k;
            if ($k1 =~  s/^(.{$diagonal})-/${1}x/os) { # diagonal xx
                $next{$k1} += $c;
                if ($k1 =~ s/^(.{$diagonal}x.{$diagonal})-/${1}x/os) {  # diagonal xxx
                    $next{$k1} += $c;
                }
            }
        }
    }
   $acu = \%next;
}

my ($k, $c) = each %$acu;
print "total: $c\n";