Most Popular Testing Modules - January 2010

Back in September 2008, I had a list of the most popular testing modules on the CPAN. I created this list because I was writing Test::Most and I needed to know them. Tonight, after hearing that the next Perl-QA hackathon is in Vienna, I thought about what I might want to accomplish and decided to see if the most popular modules had changes. In 2008, out of 373 test modules, we had the following top 20:

Chennai

I'm heading off to Chennai, India next week and I would love to see some Perl people while I am there, but Madras.pm looks a little dead. Would any mongers in or around Chennai like to meet up for a technical meeting / dinner / tea?

Hello blogs.perl.org

For my inaugural entry, I have good news: there is now a feed of all comments on the site available at https://blogs.perl.org/comments.xml.

Spreadsheet::WriteExcel with embedded charts

I've added a feature to Spreadsheet::WriteExcel to allow programmatically generated charts to be embedded in worksheets.

Here is an example which will generate something like this:

chart_area.jpg

Test::Class and FindBin

I'm on a new team at the BBC and I was rather curious to note that I couldn't run the Test::Class tests by simply doing a prove -lv t/lib/Path/To/Test.pm. A bit of research reveals the culprit is FindBin, a module I've never been terribly happy with. Seems we have configuration information located relative to the $FindBin variable that module sets.

Tabular Data, spreadsheets and cell references

Since Cantella::JobQueue has been put on hold after the discovery of Beanstalkd, I've moved on to other projects. The first on my list was to add some new views to a Reaction-based application. Specifically, I needed a couple of ways to export tabular data. I needed to display it as inline XHTML tables, export it as PDF sheets and allow for spreadsheet downloads. Because none of the current offerings gave me the flexibility I wanted, I decided to write my own.

Non Native Speakers

Well, I'm not a native Perl speaker. ;-)
I'm not even a native English speaker. Obviously. This can be hard sometimes.
Altough I would like to qualify my English as "quite o.k." I encounter problems reading documentation and code.
My problem (as I analyze it) is that I'm often unsure if I understood something correctly. And if I clearly don't, I find it hard to identify if it is due to complicated content, peculiarly used words or technical terms I don't know.

For the non-native speakers: Do you have similar problems?

For the native speakers: Imagine reading when you are really tired. I think this should feel more or less the same than reading technical writing in a foreign language.

And then all these little jokes. I really enjoy them, but they sometimes make it really hard to get the main content.

Another question for the native speakers: How do you feel when you are reading non-natively spoken (baby) English? Are you annoyed at the many mistakes?

And then: If you compare this to computing languages? Most of us are non native speakers. At least I hope so. :-)

Backing up with Dackup

I do backup... but as I'm sure with most other people, it's probably not enough.

As a Mac user I've been relying on TimeMachine for a while now and it is fantastic.

For my unix based stuff I then use git or svn and rely on my laptop having a checkout as well as a set being on the server (and the server does some backups as well).

But the main issue is it's lots of bits of "It will probably be ok" and "I'm fine if it's a hardware failure". But this doesn't cover the "what if my house burned down" type scenarios.

So anyway, with the scene set... I started thinking I needed offsite backup for everything. A service (or services) where I can upload everything to and then not worry about it.

Enter Dackup, I can upload to Amazons S3, or Rackspace's CloudFiles, or to another server over SSH, or another disk over Filesystem.

I'm already using Amazon's S3 for some stuff, so this seemed the easiest.

Cool Things in Perl 6

Yeah, Perl 6 is going to allow us to do very interesting things. Given this code:

use v6;

subset Filename of Str where { $_ ~~ :f };

sub foo (Filename $name) {
    say "Houston, we have a filename: $name";
}

my Filename $foo = $*EXECUTABLE_NAME;
foo($foo);
foo($*EXECUTABLE_NAME);
foo('no_such_file');

We get this output:

Houston, we have a filename: /Users/ovid/bin/perl6
Houston, we have a filename: /Users/ovid/bin/perl6
Constraint type check failed for parameter '$name'
in Main (file src/gen_setting.pm, line 324)

Obviously the error message needs some work (and I would love to be able to generate custom error messages for subsets), but proper use of subsets are going to save a lot of code and prevent a lot of errors.

Submit a Perl talk for OSCON before February 1

The Call for Proposals for OSCON ends on February 1.

As part of the Perl track committee, I gave some guidance in what you might propose in "How to tell your Perl story at OSCON". There are many interesting things you could talk about, even if you don't think it's interesting.

I mentioned several categories your talk might fall into:

  • The Perl language itself, and how it works
  • Using Perl features to provide programmer capabilities
  • Using other technologies from Perl
  • The process of using Perl to get work done
  • A 5 minute lightning talk

Every proposal is judged both by a committee of subject matter experts as well as the entire OSCON program committee and the organizers. Take the time to let OSCON know why your talk is the best, and remember that some of the people judging it might not know who you are or why your really cool thing is important. You're also in competition with other Perl talks, so we need a reason to pick yours over the many other Perl talks for the limited space each track gets.

Good luck!

Readable Perl

Despite what you often hear, one can produce very readable perl code.
It is just not enforced.

I feel that readabilty of my code has improved since I've started my IT bachelor studies. I'm wondering if it is because
- we are forced to learn java which enforces a lot of things
- I am much worse at java than at I am at perl which forces me to write really simple code
- I code more and am humiliated more often when trying to read my own code
- I have more confidence in my solutions and think longer before hacking.

I'm not very afraid of baby perl. I want to code efficiently and want to understand my code in a year or two.

Strange?

I just realized I will be sitting in a class for my birthday.

Either I'm doing something right or wrong.

Either way I'll be in St. Paul and will almost be able to eat my fill of pizza that I love.

So, you got mixed results from cpantesters?

Every so often you may have found yourself puzzled by the results the cpantesters provided, wondering which reasons may stand behind the fails or passes.

So you click on one of the FAIL reports and it doesn't reveal anything useful to you?

Chances are that if the reports contain some common pattern the new analysis site will point it out to you. Analysis uses some well known basic statistical tools that estimate the influence of independent variables on the result of the test runs.

http://twitter.com/briandfoy_perl

I'll tweet at (http://twitter.com/briandfoy_perl) when I have something to say in 140 characters. I'll almost always use "Perl" when I post.

Perl 6 Config::INI Improvements

I've renamed the Config::INI repository to something more sensible (since no one had watched/forked it) and now you can write out Config::INI files.

my Config::INI $config .= new;
my %properties = (
    a => 'b',
    c => 'd',
);
my %next = (
    one   => 'two',
    three => 'four',
);
$config.add_properties(:%properties);
$config.add_properties(properties => %next, name => 'next');
$config.write($ini_filename);

It needs more work (primarily solid error checking), but so far I'm fairly pleased with it.

Google Wave Invites

I have 22 Google Wave invitations. If anyone would like one, please contact me at mmusgrove@cpan.org.

I do not have a good use for Google Wave yet but perhaps you do.

Marpa: Practical General BNF Parsing

With a regular expression engine, there are expectations. You feed a regular expression to the RE engine, it parses with it. That simple.

A general BNF parser is one which fulfills the same expectation for BNF. Write your language in BNF, you got a parser. But it hasn't been that simple.

The guys who write the textbooks have pushed general BNF parsing for years. Improvements in these algorithms have pushed the speeds down to linear or close to it for the kinds of language in practical use.

But the general parsing algorithms have languished on the textbook pages. And I did find it wasn't quite as easy as the academics suggested. There were some obstacles that they didn't forsee. But bottom line, they were right. General BNF parsing is practical.

Spreadsheet::WriteExcel with Charts

In the past I've avoided trying to implement charts in Spreadsheet::WriteExcel because the task always seemed too big to tackle in the time scales that I get to work with.

However, prompted by a module user, I went back to revisit it. The task was still too big but I did it anyway.

So I've uploaded version 2.32 of Spreadsheet::WriteExcel to CPAN. Here is the documentation for Charts and here is an example.

Maintaining State in Perl 6 Grammars?

I've been curious how one would match the following with Perl 6 grammars/regexen (spaces represented by dots)?

    XXXX
    ..XXXX
    ....XXXX
    ....XXXX
    ......XXXX
    ..XXXX

In short, you can indent or unindent by a particular amount, with allowed indentation levels being multiples of the first indentation amount found. Each level of indentation must equal the previous or be one greater. You can unindent as much as you want so long as it's a multiple of that first indentation level. Seems like you need to have a recursive grammar that allows you to maintain state.

This is to play with the idea of matching a "YAMLish" document.

Side note: since Perl 6 is "Perl 6" and not "Perl6", it's awfully hard to search Google for.

Putting does() in Intermediate Perl

I'm thinking about what a second edition of Intermediate Perl would look like. Of course, I would update it for Perl 5.12 (having been targeted at 5.8). Part of that is the new Perl 5.10 does() feature that replaces most uses of isa(). I want to come up with some good examples to show off does() and roles for the next edition. It's not as easy as I thought it would be.

I won't go into the history of does(): look for chromatic's various writings on that. In short, does() asks something it if has a set of behaviors. It's almost that interface stuff that Java has.

There's a problem constructing working examples though. Who gets to define the names of the behaviors? There is still the false cognate problem that does() was supposed to ameliorate. Two different interfaces give themselves the same name. It doesn't have to be for any good reason. Let's just leave it at "people suck at naming".

About blogs.perl.org

blogs.perl.org is a common blogging platform for the Perl community. Written in Perl with a graphic design donated by Six Apart, Ltd.