Perils of Plugins

Plugin-based architectures can be a bad idea.

Not always. In user-facing applications, where the list of installed and enabled plugins is clear, then plugins are often a good thing. This article is concerned not with end-user facing applications, but with libraries. Libraries that allow their functionality to be extended through plugins. In particular, libraries that automatically detect and load all installed plugins.

Plugins aren't always obviously plugins. In this article, I'm defining a plugin as a software module that adds additional functionality or modifies the externally observable behaviour of the existing functionality of the core piece of software. Call it a "plugin" or an "optional dependency" - it's the same thing.

Here's a simple hypothetical example:

Module Comparisons and Reviews

Hi Folks

Recently, Steven Haryanto blogged about articles which compare modules, and made an impressive start with this wiki entry.

I've added a similar page to my web site.

I've called it 'Module reviews' rather than 'Module comparisons' so as to allow for related articles which are not exactly comparisons.

If you have any recommendations regarding similar articles, let us know.

Lastly, please link to either or both these pages. The more links to Perl stuff that the search engines stumble over, the more visible we'll be.

Business::Shipping clobbers your Log4perl config

Just an FYI, if you're using Business::Shipping in your app and also Log4perl, then Business::Shipping will clobber your Log4Perl config with it's own. A quick work around for this is:

use Business::Shipping;
Log::Log4perl->init($your_own_config_file_path_goes_here);

Basically clobber Business::Shipping right back.

If I get some round-tuits I'll submit a patch to fix this problem. If the author of Business::Shipping were using something like Log::Any then he could spew out his logs, and the consumers of Business::Shipping could simply load the appropriate adapter rather than having Business::Shipping clobber the Log4perl global config. I guess technically this could be a bug in Log4perl using globals too. Anyway, this little work around should get you by in the mean time until a patch can be authored to remedy the problem.

Crypt-SSLeay 0.60

I just uploaded to Crypt-SSLeay 0.60 to PAUSE to address RT #77167 and CPAN testers failures with the previously released version. The former was due to the fact that SSL v2 is no longer supported on various platforms, and the latter due to the fact that LWP::Protocol::https was not specified as a dependency.

Most of the changes leading up to 0.59_03 were similarly minor and straightforward. However, one addressing RT #64054 attempted to deal with incomplete reads and writes in a better way, and is a significant change from the original codebase.

Lightning Talks

A grand tradition of the YAPC::Europe are the Lightning Talks, 5 minute presentations about any topic. We plan three sessions of Lightning Talks, one every day. Léon Brocard has graciously agreed to host the Lightning Talks.

Learn more about Lightning Talks at http://act.yapc.eu/ye2012/talk/4016.

If you have a presentation for a Lightning Talk session, submit it via http://act.yapc.eu/ye2012/newtalk.

Even less hassle when benchmarking Perl code

About a year ago I blogged about Bench, a simpler alternative to Benchmark. I got tired of having to type this on the terminal:

% perl -MBenchmark -e'timethis($count, "code")'
% perl -MBenchmark -e'timethese($count, {label1 => sub { code1 }, label2 => sub { code2 })'

I dislike the interface because it forces me to remember/decide/do too many things. I don't want to have to remember whether to use timethis()/timethese(). I don't want to have to pick the appropriate $count. I don't want to have to label the subs. With Bench I can just type:

% perl -MBench -e'bench sub { code }'
% perl -MBench -e'bench [sub { code1 }, sub { code2 }]'

Guess what, I got tired of having to type the above too :-) So now with the latest release of Bench, a command-line script bench is provided. You can now just type:

Teaching Perl with Comedy

While testing some code for an forum answer i made a stupid mistake. It was late, I didn't thought of it, why in the world should I name the Module "Test" and wonder then why it behaves unexpected (I do know why! - some newb might not). But the more glorious idea is that we all have such moments and hide them carefully. Why not pile the xp up and make a Perl course out of it by showing what can go wrong and maybe even write it like a comedy? I saw even a motion picture in my mind about someone ranting how bad Perl is while making such moves.

Tuts are hard work, I know because i wrote some. To set up all the traps that a screwball comedy comes out of it that actually works dramaturgically should be even harder. But maybe someone runs with the idea.

Meetup.com Event for The Perl Foundation Community Symposium

Meetup.com Event for The Perl Foundation Community Symposium

[From the YAPC::NA Blog.]

What package provides gdlib-config in your distribution?

I just tried to install GD from CPAN. It complained that gdlib-config is missing and that I should install libgd.
After some search I found out that in Ubuntu gdlib-config is provided by libgd2-xpm-dev and not by libgd.

So I am sending a patch to Lincol Stein to have a better error message, but it would be nice if I could included the names of the correct packages from other Linux distributions.

Hence the question.

What package provides gdlib-config in your distribution?

Activities in Frankfurt for you and your partners

Just because you're coming to a conference doesn't mean your loved ones must stay back home. And if they do come with you, the fact that you're at the conference doesn't mean they have to stay at the hotel.

We've put together some activities in and around Frankfurt on the wiki

My blogs.perl.org profile image is now some other dude

I just filed a bug about my profile image being replaced by that of some other user on the site. I wonder if anyone else had had this issue.

Bugfix in Name Input

Perlybook.org is now available in version 0.13.
Continue enjoying all the Docs from CPAN in your Ebook-Reader of choice.

This fixes a bug, concerning some input like e.g. Log::Log4perl.
Because MetaCPAN's autocompletion was used to match user-input to something valid, you always got an ebook about Tie::Log4perl (which is autocomplete-suggestion number one in this case) - so this is fixed now and you will get the book you want.

The downside of this is that the input allows no more typos and is case sensitive too! But that's not a big issue if you use a browser with JS enabled... JQuery will fill up the form correctly with a bit of your help.

Secondly a minor bug is fixed so that you should be able to download your ebook of choice directly from you Kindle Reader if you have some WLAN around. I would like to hear some feedback about this on github or as comments here in the blog. Because on my Kindle Reader (there is no model name written on this thing, I don't even know which model it is) I can now download (which I couldn't before) but - very strange - I can't open the book... would like to hear if others have the same issue.

Thanks

Introducing trash-u (File::Trash::Undoable)

Python has trash-cli, Bash has rmv, now Perl has trash-u (from File::Trash::Undoable, which in turns wraps File::Trash::FreeDesktop).

To trash your files:

% trash-u foo.tmp *.bak

To see the contents of your trash:

% trash-u --list-contents

To empty your trash:

% trash-u --empty

Unlike trash-cli (and like rmv), trash-u supports undo (called rollback in rmv). And unlike rmv, trash-u supports redo. Multiple undo/redo is supported. It's also worth noting that rmv currently does not support per-filesystem trash (everything goes to $HOME, which might cause heavy copying between devices).

To undo your last action:

% trash-u --undo

And to redo:

% trash-u --redo

To see your actions history:

% trash-u --history

To discard history (forget undo/redo information):

% trash-u --clear-history

trash-u also supports dry-run mode to show what's going to be deleted:

% trash-u foo.tmp *.bak --dry-run --verbose

Some notes:

Prefixing the Ruby Slippers, and the Bigfoot Maneuver

Glinda cover

In my last post I talked about partial parsing of Perl using my new parsing algorithm, Marpa. This post explains how I do it. For those interested, the code for the example in my last post can be found in t/curly2.t in Marpa::R2 2.015_001 (a developer's version). For convenience, I've also pulled t/curly2.t out as a Github gist.

Introducing the problem

This technique will work for languages other than Perl. In fact, this technique could be used to look for several different target languages at once, for example, when searching a database of emails that might include code segments in Perl, HTML, C, etc.

For clarity, I will often refer to the Perl and C programs being sought as targets in text as "code segments". In the context of this blog post, a string is only considered to be a valid "code segment" if it is also a valid and complete program.

New coding style?

Some of my cPanel colleagues came up with a new coding style. They are standing.

carpal_tunnel.jpg

First it was Phil King standing in his office, after first attempts with a big ball failed and his back still hurts sometimes. Now Nick Jackson (on the picture) joined him, and others announced to follow.

This desk is called geek desk and has a motor and remote control attached.

Start times for the conference

We don't have the schedule for the talks yet. To help you plan your travels, here is the rough plan into which the talks will fit:

Monday 20th, 9am to 10:30 registration
10:30 start of the conference, keynote
19pm - Social event at Depot 1899

Tuesday 21st, 10am start of the conference day 2
17:30 - end of last talk of day 2

Wednesday 22nd, 10am of the conference day 3
17:00 - end of last talk of day 3

We'll publish the more exact times once the schedule gets more solid and we've checked with the venue on the lunch times.

List of Perl modules comparison articles

Just created a wiki page at the Perl 5 Wiki, mainly to catalog the great work that Neil Bowers has done. Hopefully it can be helpful for module shoppers. The page should probably be linked from elsewhere.

Perl Social Event, Tuesday August 7th, Downtown Chicago

The Perl Foundation is having a Community Advocacy kick-off event in Chicago on August 7th.  It’s going to be a fun, social event with talk about community. A “symposium” (check out the dictionary definition).  It will be in a nice Irish pub with room for 72 people in a private upstairs area.   Food and drink will be available, possibly some sponsored.

Contact Yaakov Sloman <yaakov@perlfoundation.org> with your questions.

As we have more details we’ll keep you informed.

[From the YAPC::NA Blog.]

Alien::Base Perl Foundation Grant Report Month 5

After another busy month outside of the Perl world, I have gotten a little more time in the last week to work on Alien::Base. I must especially thank fellow WindyCity.pm member David Mertens for working with me on some of the Mac problems involved.

N.B. I also want to thank him for PDL::Graphics::Prima, which made the rest of my $work easier this month! If you need interactive plotting, give it a look! Also Chicagoans, WindyCity.pm is tomorrow, topic: Dancer.

catchable by gimmicks

The Kephra rewrite is doing very well, expect some great revelations even for Wx programming in genereal. But today i just want to rant about bibucket, which hosts my hg repo for most of my projects. I mean i like mercurial better then git, or should I say liked. the more I learn about the raw awesome power of git the more I find it perlish. But surprisingly what bit me just today is that bitbucket doesn't have this nice graphs. I just underestimated how motivating they can be.

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.