Recently in CPAN Category

Perlbuzz news roundup for 2010-08-27

| No Comments

These links are collected from the Perlbuzz Twitter feed. If you have suggestions for news bits, please mail me at andy@perlbuzz.com.

Run PHP tests in your Perl test suite

| 5 Comments

Sometimes you've got a big codebase that isn't just Perl. Maybe you've got PHP mixed in with it, and you want to test the PHP along with all the Perl code, too. Perl's prove program doesn't care if the testing results it parses are from Perl, PHP or even static files, so long as they're in the TAP format. However, actually getting prove to run those PHP programs takes a little doing. Fortunately, Test::Harness 3.xx has hooks for source handlers.

David Wheeler has written about running PostgreSQL tests under prove in his blog and I stole from his code shamelessly to create TAP::Parser::SourceHandler::PHP, released to the CPAN this morning.

So now, to run the Perl .t files and the PHP .phpt files all in one swell foop, here's what we do at work:

prove -r \
    -I/home/alester/proj/Lib \
    --source=Perl --ext=.t \
    --source=PHP \
    --ext=.phpt \
    --php-option=include_path=/home/alester/proj/Class \
    --php-option=extension=.phpt

That --source=PHP tells prove to load up TAP::Parser::SourceHandler::PHP. The --php-option tells prove to pass those options through to the SourceHandler. If we had PostgreSQL tests or MySQL tests, we could use the SourceHandlers for those that David Wheeler has written as well.

Now we can test everything all in one run, and we get all the benefits of Test::Harness 3.xx, like parallel tests and TAP archiving and so on.

Perlbuzz news roundup for 2010-08-09

| No Comments

These links are collected from the Perlbuzz Twitter feed. If you have suggestions for news bits, please mail me at andy@perlbuzz.com.

Perlbuzz news roundup for 2010-07-27

| No Comments


These links are collected from the Perlbuzz Twitter feed. If you have suggestions for news bits, please mail me at andy@perlbuzz.com.

Perlbuzz news roundup for 2010-07-06

| 2 Comments

These links are collected from the Perlbuzz Twitter feed. If you have suggestions for news bits, please mail me at andy@perlbuzz.com.

There's more than one bug tracker for CPAN

| No Comments

Diversification in bug tracking has come to the CPAN. Module users cannot assume that the bug tracker for an individual module is at rt.cpan.org. Before submitting bug reports, users should check the distribution's page on search.cpan.org for a link to the bug tracker, and also check the documentation for the module. When in doubt, go with the documentation.

It used to be simpler....

Over ten years ago, when CPAN only had a few thousand distributions, and free project hosting was Sourceforge or nothing, Jesse Vincent stepped up to create rt.cpan.org. It was, and is, a fantastic service. Module authors now had free, centralized bug reporting that they didn't have to maintain themselves.

Jesse's RT setup also has the advantage of integrating with PAUSE and the CPAN. CPAN is the Comprehensive Perl Archive Network, and PAUSE is the Perl Author Upload Server. When a module author has a distribution for release, she uploads the file to PAUSE. From there, the servers that make up the network part of CPAN mirror the file for your use. Jesse set up RT to check the PAUSE for new distributions, and when one was found, RT would automatically create a bug queue for that module. It's still a fantastic system, and we should all thank Jesse for maintaining it.

For years, the Perl community has been enjoying the fruits of rt.cpan.org. It's become part of Perl culture. The home page for each module on search.cpan.org includes links to the RT page. When authors create modules with Module::Starter, the module's documentation refers the reader to the specific bug queue. People just knew that it was there. Everyone knew you could email to bug-distro-name@rt.cpan.org to have a bug reported.

But RT has never been the the only bug tracker available, and the alternatives are getting more and more use. SourceForge has had bug tracking for quite a while, but when Google Code came out with project hosting and bug tracking, things started changing. Now, Github has taken the Perl world by storm. For the first time ever, we module authors had solid alternatives to RT that we didn't have to create ourselves.

That leads us to today, where the Perl world is continuing to diversify. Module authors can choose the bug tracking system that suits them, and their users, best. That system may no longer be RT.

Which bug trackers are getting used?

When I checked last week, I found 106 distributions that were using bug trackers other than RT, spread across 10 different domains.

For example:

  • http://code.google.com/p/perldts/issues/list
  • http://github.com/ap/Object-Tiny-Lvalue/issues
  • https://gna.org/bugs/?group=testautobuild
  • http://sdlperl.ath.cx/projects/SDLPerl
  • https://issues.apache.org/SpamAssassin/
  • http://sourceforge.net/tracker/?group_id=199719
  • http://padre.perlide.org/trac/
  • http://www.w3.org/Bugs/Public/
  • https://openmelody.lighthouseapp.com/projects/26604-melody
  • http://www.veripool.org/ipc-locker-bugs

I was surprised the number of distributions was only 106. I suspect that there are many module authors who don't know how to specify an alternate bug tracker in their distributions. In my next article, I'll explain how to do that.

Artistic License 2.0 makes dual-license boilerplate unnecessary

| 1 Comment

The dual-licensing in much module boilerplate these days is unnecessary. You can simplify your licensing by using only the Artistic License 2.0.

There are plenty of modules out there that license themselves "under the same terms as Perl itself", and there are problems with that approach. For the past year or so I've been using the approach of being explicit about "Artistic or GPL, your choice", but that's unnecessary, too.

According to Allison Randal, one of the architects of Artistic License 2.0, "Artistic 2 allows for any GPL-like license, not just GPL 2. Specifically, it allows for GPL 3 or later, or a completely non-GPL copyleft license. So, the dual license is unnecessary."

There's a page on the Perl Foundation website about CPAN licensing guidelines that explains more options in more detail.

From here on out, my code is going to say:

=head1 LICENSE

Copyright (C) 2010, Andy Lester,

This module is free software.  You can redistribute it and/or
modify it under the terms of the Artistic License 2.0.

This program is distributed in the hope that it will be useful,
but without any warranty; without even the implied warranty of
merchantability or fitness for a particular purpose.

Perlbuzz news roundup for 2010-05-28

| No Comments

These links are collected from the Perlbuzz Twitter feed. If you have suggestions for news bits, please mail me at andy@perlbuzz.com.

Perlbuzz news roundup for 2010-04-22

| No Comments

These links are collected from the Perlbuzz Twitter feed. If you have suggestions for news bits, please mail me at andy@perlbuzz.com.

Perlbuzz news roundup for 2010-04-05

| No Comments

These links are collected from the Perlbuzz Twitter feed. If you have suggestions for news bits, please mail me at andy@perlbuzz.com.

« Conferences | Main Index | Archives | Interviews »