I'm going to the Nordic Perl Workshop

The Nordic Perl Workshop is in Malmö on June 18-19. That's just across the bridge from Copenhagen and is quite a nice little city which I visited the last time I went to Copenhagen (or was it the time before that?).

I'm going to get there a little early though. I'm flying to Zurich so I can visit Liechtenstein the weekend before; I always want to visit but things get in the way. I'll be in Zurich on Sunday, June 12. I know a couple of Perl people must be there.

Once I do that, I'm flying up to Copenhagen on Monday, June 13. After that I have to find something to do with myself until the conference starts. Does anyone in the area need some CPAN-related work done. :)

python2.6 for dotcloud

Dotcloud now supports perl. Dotcloud command-line interface requires python 2.6. Here are the steps I used to install python2.6 on mac 10.5.8

wget http://python.org/ftp/python/2.6/Python-2.6.tgz
tar -xvf Python-2.6.tgz
cd Python-2.6
./configure --prefix=/usr/local/python2.6
make
sudo make install

#add /usr/local/python/bin to your ~/.bash_profile
wget http://pypi.python.org/packages/2.6/s/setuptools/setuptools-0.6c11-py2.6.egg#md5=bfa92100bd772d5a213eedd356d64086

sudo su -
#make sure python -V is 2.6
sh setuptools-0.6c11-py2.6.egg

#now you can use the easy_install which is installed under /usr/local/python/bin/easy_install to install dotcloud
sudo easy_install dotcloud

Now follow the instructions Here on getting started with dotcloud.

Dancer release codename "Silence of the ambs" is...

...already out for a while now! :)

Dealing with personal issues this past month, I couldn't find the time nor motivation to blog. It's not that things aren't happening, they are, at a pretty serious pace. We've already released Dancer 1.3030 (codename "Silence of the ambs"), named after Alberto Simões, who has become a major force in the Dancer community. You can read the release notes here.

Yesterday I released RC1 for a new release, named after - you guessed it! - another member of the Dancer community. We haven't revealed who it is yet, but I can safely say that he has contributed to Dancer in various ways (code, articles, cleanups) and is always very pleasant and fun to work with. We have tremendous respect for him and always wanted to express it, and unfortunately naming the next release after him is the only way of which we could think! :)

Following this release (hopefully officially stable to be released this weekend), we will work on another release with a pretty huge change. While the release will be named after a Dancer core developer, credit should (and will also) go to JT Smith for relentlessly pushing the feature the release will carry.

Oh yeah, and you can now use Dancer on DotCloud.com!

Nordic Perl Workshop 2011

I just learned that Nordic Perl Workshop 2011 will take place in Malmö on June 18 and 19.

NPW 2011 page

As it's just across Øresund from Copenhagen, I'll definitely be there. I hope you will too!

Metabase back online

The Metabase is now back online, and accepting reports again. If you're running a metabase-relayd instance, you should be safe to turn it back into online mode. Many thanks to David Golden for working with the EC2 instance to get it all working again.

It may still take a few days for everything to get back to normal, so please bear with us. If you do spot any lingering problems, please post to the cpan-testers-discuss mailing list and let us know.

Cross-posted from the CPAN Testers Blog

Was it something I said?

This morning I re-tweeted a a post from @petdance where he says (or, moreover, I understood him to say) OpenSource developers can be surly. I agree.

Shortly thereafter, I read a post from @briandfoy_perl and discovered, much to my discomfort, that this is part of a larger conversation about the perl community specifically.

To summarize, the post of Andy's that I originally saw seemed to me fairly innocuous, to the tune of "open source developers have a responsibility to bat down the trolls for the good of their communities". Brian then responds in his own post (linked above) defending the Perl community specifically and saying Andy's position is perverted because Andy interactions with the Perl community are mostly via mailing lists and website forum comments and that these are among the most toxic forums.

The Perl Community is great

The Perl community is a great group of people. chromatic and Andy Lester don't think so because they limit their involvement to the most toxic things man has ever created: the mailing list thread and website comments. There's nothing surprising about bad behavior in either of those places and it has nothing to do with Perl. It happens everywhere you find a mailing list or a comment section.

Show up to a Perl event with real people and you'll find a much different reality. :)

NERDTree on Startup

If you use vim and you have haven't seen the excellent NERDTree plugin, you should really check it out.

I wanted NERDTree to automatically load if I start vim without arguments, so I added the following to my .vimrc:

function! StartUp()                                                                                                                                                                                         
    if 0 == argc()
        NERDTree
    end
endfunction

autocmd VimEnter * call StartUp()

Very handy. I expect I might be adding more to my StartUp function in the future.

As a side note, it installs via a Rakefile, but if you don't have Rake available, I hacked the Rakefile to make this installable via bog-standard Ruby:

You can solve any problem by adding another layer of indirection

During the Easter weekend, I've started to write code supporting Firefox 4 in WWW::Mechanize::Firefox. So far, only some ugly parts of the restructuring of Firefox have broken WWW::Mechanize::Firefox. As my main application for it still runs Firefox 3.x, I have to support both versions, and especially not break any functionality for 3.x. So far, I could put most of the differences between Firefox 3.x and Firefox 4 into two submodules, WWW::Mechanize::Firefox::API35 respectively WWW::Mechanize::Firefox::API40. The constructor of WWW::Mechanize::Firefox does return either of these subclasses, depending on the version. This proves that you can't solve the problem of too many indirections by adding another layer.

Every Perl module needs a test file


Test driven development is a must, that's why I think it is necessary to check that there is at least a test for every module specially if you can't know a priori how much will be populated a namespace, for example if you decide to have plugins .

So here it comes a very nice core module called Module::Pluggable ! For sure ti can help a lot !

Read a short explanation ( more code than words :) in
this article .

Organizing the Perl QA Hackathon 2011

It's been almost a week since the Perl QA Hackathon 2011 in Amsterdam is over. As usual since 2008, the main topics were the Test and CPAN toolchains. Other people will talk a lot better than me about the work they achieved during these three days.

In this post, I'd like to give some information about the organization.

File::Slurp 9999.16 is on CPAN

After too long a wait, I have updated File::Slurp with a long list of requested features and bug fixes. See the Changes file for the changes in the recent burst of 3 releases. Major changes include adding prepend_file() (this inserts data at the beginning of a file), the binmode option supports all the values of the binmode function, a rewritten and improved benchmark script and more synopsis examples.

In the near future, expect to see the subs edit_file() and edit_file_lines(). These support modifying a file in-place from inside your Perl program (similar to -pi on the command line).

ElasticSearch.pm v0.36, now with extra sugar

ElasticSearch v 0.16.0 was released yesterday with a long list of new features, enhancements and bug fixes.

ElasticSearch.pm v 0.36 is on its way to CPAN as we speak.

Besides adding support for the new stuff in v 0.16, I've also added a few features:

scrolled_search()

It is possible to scroll through a long list of results in ElasticSearch, but this required a bit of repetitive code, which is now nicely packaged up in scrolled_search. So you can do:

Here's a stupid bug.

Suppose you want to check if a number is either 70 or 73, and your duct-tape-and-chewing gum production environment is stuck in the stone age without the smart-match operator.

You might be tempted to write foo() if $num =~ /^70|73$/, as I did. Oops. That will match 70 and 73, but also anything that ends in 73, like 173 or 273 or foo73. /^(?:70|73)$/ fixes it.

The moral of the story: life sucks without smartmatch.

The 1% Testing Solution

I recently wrote about 80% hacks and this post is closely related to that. The overall concept is "don't let the perfect be the enemy of the good".

When it comes to identifying issues in building tools, we often think of a "perfect" solution and then try to implement it. Business objects to this because they want to develop products, not test code. Developers object to the business because they want to know their code works. This tension is very difficult to resolve, so I fall back on my favorite example:

sub reciprocal {
    croak "Reciprocal of 0 is not allowed" unless $_[0];
    return 1/$_[0];
}

Right off the bat, I could see people writing two tests for that: one for zero as an argument and one for a non-zero argument. And you know what? That will get you 100% test coverage on this function and that's where the whole "know their code works" argument falls down.

Effective Perl Programming 2e is Today's deal of the day at informit.com

I hope no one thinks this is spammy, I just want to spread the word before the deal goes away,

Go grab your copy of Effective Perl Programming 2e

So your web app double posts?

This post is just in case I forget this again in the future. Hopefully, I'll find it when I search the net for this issue.

This post is testament of my tenacity (more like my stupidity when I let myself get mentally exhausted).

I have been working on integrating some Mojolicious apps into our existing Apache CGI/mod_perl set of applications. When I went to test the latest version of a particular app, that changed how things were added, I decided to put some warn statements in to see if I had the flow right. Looking in the error log, I started seeing everything happening twice!

The methods that get used to create the initial view. The methods that get used to add a new item and subsequently view it. Everything.

EC2 Servers downtime affects Metabase

You may have heard that Amazon's EC2 Web Services have been having some problems today. As a consequence several major sites have been down. Although perhaps not a major site in the grand scheme of things, a major site for CPAN Testers is the Metabase server. It is also hosted on an EC2 server, which has been experiencing downtime.

If you're running a CPAN Testers smoker with metabase-relayd, thanks to Chris Williams' forward planning, you can now run it in offline mode as:

metabase-relayd --offline

In Chris' own words:

> It will still collect test reports, but it won't submit them to the metabase.
>
> I knew there was another reason for writing a relay.
>
> /me skips away going 'la la la'
>
> :)

If you're not using the relay, then you may need to stop testing until the EC2 servers come back online. We'll try and keep an eye on things and let you know when all has returned to normal.

/me prepares for Chris' 100k+ report submissions when he switches his relay back to online mode!

Cross-posted from the CPAN Testers Blog

The one thing you must know about the perl.beginners list

Peter Scott recently emailed the regular reminder to people that the perl.beginners list was created to be a completely flame-free environment.

This means that if someone has posted a completely RTFM question, you can point them to the answer, but that F had better be fracking silent.

See what I did there? I used an "F" word. Why? This is my fracking blog. If you don't like my "F" word, too bad. It's my fracking blog. Not yours. Mine.

Similarly, the perl.beginners mailing list is probably not yours. While some of the people responding to Peter Scott's email had perfectly valid reasons why being overly gentle isn't always a good thing, the overriding point is simple: the blog was created to be a flame-free environment. If you object to that, that's OK. However, you're probably not the list creator and thus, you don't get to make the rules.

If you don't like the rules, that's OK. If you can't play by the rules, it's not. I thought people were taught this when they were five years old, but obviously I was wrong.

Introduction to blogs.perl.org + Text::Table

Hello, Perl bloggers! I decided to start blogging about a most of my exclusively Perl-related stuff here on blogs.perl.org, in hope of getting more comments from active Perlers. (Until now, I've blogged about it on my technical LiveJournal blog and previously on use.perl.org Journal.). You can learn more about me on my home site - www.shlomifish.org .

OK, having put that aside - let's move on to the main topic of this post.


Many months ago I wanted to use the Text::Table CPAN module to present a table related to the meta-scan heuristics construction scheme of Freecell Solver. Now, I wanted to present nicely formatted borders, using the Unicode box-drawing characters (which some people would recall from DOS). However, I found it difficult to specify the separators in the rulers properly based on their indices - they were assumed to be the same globally. As a result, I've written a patch, and placed the modifications in a github repository.

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.