Portuguese Perl Workshop 2012

The Portuguese Perl Workshop is back, the event will be held on September 28th in Braga, Portugal.

Check the workshop website for more information.

Portuguese Perl Workshop 2011

The Portuguese Perl Workshop is back. This year's event will be held in the 22nd and 23rd of September in sunny Lisbon, where the grass is green and the girls are pretty.

Check the official site for details.

OpenCert 2010

This weekend I gave a presentation at OpenCert 2010 about the Perl testing ecosystem, this was an article I wrote with ambs++ and jjoao++. The article can be found on the conference site here.

Begin at the BEGIN and go on till you come to the END: then stop.

In Perl we can run user defined code blocks at different stages when running a program.

  1. BEGIN blocks are run as soon as Perl finds them. If there is more than one block they get executed in the order they are found.
  2. CHECK blocks are run as soon as Perl finishes compiling. If there is more than one CHECK block they get executed in the reverse order they are found.
  3. INIT blocks are executed after CHECK blocks, and if more than one exists they get executed in the order they appear.
  4. END blo…

Perl6 modules in Rakudo baby-steps, part 1

Here is an example of what a module can look like. In this case it only has a simple method that greets the user:

class Greeter;

method greet($name = 'world') {
say "hello $name";
}


Now to use the module we can write something like:

BEGIN { @*INC.push('Greeter/lib') }

use Greeter;
my $x = Greeter.new;
$x.greet('rakudo');


The only tricky part is actually the push in the BEGIN block, to add your lib directory. Of course running this is as simple as:

$ ./perl6 greeter.p6 
hello rakudo