Annotations, Attributes, Traits - Part II

This post is a continuation of Annotations, Attributes, Traits and explores the different options for applying metadata that are available to Perl, and what is needed to make these options available for third-party modules to use.

Posted in Perl 5 | Full Article and Comments

Annotations, Attributes, Traits

At last year's LPW, Stevan Little demonstrated a draft implementation of a new class system for Perl 5 (talk video can be found here). Here is how the proposed syntax works:

class Point {
    has $x ( is => 'rw' ) = 0;
    has $y ( is => 'rw' ) = 0;

    method clear {
        ($x, $y) = (0, 0);
    }
}

One of the questions that came up during the discussion afterwards was what is the best syntax for declaring the rich sets of additional metadata associated with class members and methods. This post is my take on the options that we have.

Posted in Perl 5 | Full Article and Comments

Win32 Perl Awsomeness

This week's post was supposed to be about something entirely different, but I had a huge 'WOW!' moment today that I just need to share. So I had to write a quick web scraping script but I happened to be working on a new Win32 machine that did not have Perl installed yet. I installed the latest Strawberry Perl and since I did not have a text editor configured on that machine either decided I will get Padre as well. I typed cpan Padre and I watched all of Padre's dependencies install flawlessly without a hitch. For the first time ever. In my lifetime. (Padre itself did fail a bunch of tests, so in the end I had to force install it anyway, but Padre has never been advertised as stable software anyway).

Posted in Perl 5 | Full Article and Comments