November 2009 Archives

Pop Quiz Time!

Assuming no bugs in the code or anything done "fancy", is the following code Perl?

$cssClass = "";
if ( $element->isOpen() ) {
    $cssClass = ' class="selected"';
}
if ( !$element->isHiddenInNavigation() ) {
    $filepath = $element->getId() . ".html";
    if ( substr( $element->getFilePath(), 0, 4 ) == 'http' ) {
        $filepath = $element->getFilePath();
    }
    $result .= '<li' 
      . $cssClass
      . '><a href="'
      . $filepath . '">'
      . $element->getLabel() . '</a>'
      . $this->generate( $elemen…

Giggling

You ever have days when you can't stop giggling? As an ex-COBOL programmer, I laughed out loud at the idea of object-oriented COBOL. Today I'm giggling at a paper entitled What does aspect-oriented programming mean to Cobol? (PDF). I can tell you want it means, but this should be a family-friendly blog. AOP was another way to get around the limitations of inheritance, but I think it's fundamentally broken. Applying a fundamentally broken technology to an obsolete (yet needed) technology just leaves me in a fit of…

Why blogs.perl.org?

If I recall correctly, this project started a year and a half ago in Copenhagen when several of us were talking about the idea of having a modern blogging platform for the Perl community. Naturally, it had to be written in Perl. We've deliberately kept this low-key as we have known others talk about this before, but nothing came of it. It's good that we kept it low key because it's been a long time coming.

There was a private mailing list and we (participants can out themselves if they choose) discussed at length the various features we might want. While we never had complete agre…

Alternatives To Inheritance

This is repost of a use.perl entry I made. You can clearly see the "before" and "after". Which do you prefer?


I'm planning to write a long article about alternatives to inheritance. Part of the issues with multiple inheritance in Perl programs seems to stem, in part, because there doesn't seem to be enough written about this from the Perl perspective

There's also not enough perspective from a "large-scale" standpoint. I still recall one person defending "mixins" because in years of programming, he's only been bit…

Test::Aggregate::Nested

Currently I'm trying to convert our work test suite over to Test::Aggregate::Nested. This is an alternative to Test::Aggregate which is much cleaner internally and relies on nested TAP, available in the latest versions of the Test::Simple distribution. Using it is pretty simple:

use Test::Aggregate::Nested;

my $tests = Test::Aggregate::Ne…

So close, so close ...

It appears that, at long last, we'll get a proper blogging platform! With syntax highlighting:

    sub add_to_list {
        my ( $self, $text ) = @_;
        return unless defined $text;
        $text = $self->interpolate($text);

        # This horror of horrors is because we want simple lists to be single
        # spaced, unless there are further details after the =item line, in which
        # case an extra newline is needed for pleasant formatting.
        my $break = '';
        if ( $self->list_data =~ /\n.ITEM\n.*\n$/ && $text !~ /^.ITEM/ ) {
    …

About Ovid

user-pic Have Perl; Will Travel. Freelance Perl/Testing/Agile consultant. Photo by http://www.circle23.com/. Warning: that site is not safe for work. The photographer is a good friend of mine, though, and it's appropriate to credit his work.