Understanding Behavior Driven Development

I think I'm on the verge of drinking the Cucumber flavored Kool-Aid, which is odd because I've never done Behavior Driven Development (BDD) before. If you've followed my blogs over the years, you know that I am happy to investigate new trends, but at the same time I'm deeply, deeply suspicious of them. BDD has been one of those "fads" that I've been suspicious of, but I think I've changed my mind. What follows is why.

Encourage user participation via a single-line patch to your dist metadata

If you have been browsing MetaCPAN lately, you may have noticed a new shiny red ball ribbon on the left side of some distibution pages. What you may not have realized is that this is a generic feature, and you can add one to your distribution just as easily.

TL;DR: All you need to do is add an IRC resource to your metadata:
  • For Meta2.0 (META.json):
      ...
      "resources" : {
        "x_IRC" : "irc://irc.perl.org/#name-of-your-channel"
        ...
    
  • For Meta1.4 (META.yml):
      ...
      resources:
        IRC: irc://irc.perl.org/#name-of-your-channel
        ...
    

And that's it! Note that not only irc.perl.org but any IRC network (including irc.freenode.net) is supported.

For the curious the current logic picking apart this part of the dist metadata can be found here.

Many many thanks to @haarg and @oiami for implementing the actual feature, and to all participants of the corresponding ticket.

More questions? Chat with us :)

Un Exemple Senzill d'Elasticsearch

Un Exemple Senzill d'Elasticsearch

Elasticsearch és un motor de cerca. Fem un petit exemple com es pot utilitzar-ho. Necessitem unes dades per cercar, per tant agafem unes receptes d'internet, gràcies a http://receptes.cat. Un cop tenim les receptes, llavors les podem indexar en elasticsearch, després del qual podem cercar-les.

L'article complet

Strawberry Perl 5.20.1.1 released

Strawberry Perl 5.20.1.1 is available at http://strawberryperl.com

More details in Release Notes:
http://strawberryperl.com/release-notes/5.20.1.1-32bit.html
http://strawberryperl.com/release-notes/5.20.1.1-64bit.html

I would like to thank our sponsor Enlightened Perl Organisation for resources provided to our project.

Sometimes Agile Can Hurt Your Company

I've been rather quiet lately because I'm busy, busy, busy. Part of this is contract work for a company (amongst other things, I've been doing building sqitch setup for them), and part of this is new research into Agile. Today I wrote a quick blog post explaining one of my pet peeves about Agile: people say it's not a silver bullet, but they don't say why. I briefly explain when you should and should not use Agile.

Object::Util

I've recently released a new module called Object::Util to CPAN. This is a set of handy methods for working with classes and objects in Perl. It is inspired by Safe::Isa, a module which takes advantage of the fact that coderefs may be called as methods on Perl objects:

   my $method = sub { ... };
   $object->$method(@args);

Object::Util gives you a set of coderef utility methods that are applicable to a wide range of classes and objects.

Making the Switch to Strawberry Perl


So, I finally made the switch from ActivePerl to Strawberry Perl. Though I was aware of it, I had never looked at Strawberry Perl before because even though I had experienced some minor annoyances with ActiveState's Perl (and one major one, when they completely broke Tk a while back), it worked fine for me most of the time. In addition to ActiveState's Perl, I also use Perl under Cygwin.

The reason I use Windows is not because I'm a huge fan. I'd have an easier time with these types of issues on a different OS like Linux. I started out preferring Windows because I was an avid gamer, and I ended up developing a bunch of tools that I use routinely, so until I port them, I'm stuck for now. This story involves Windows 7, if you were curious.

Install XML::LibXML without root

Get a source tarball for libxml2-dev. On `apt` systems:

apt-get source libxml2-dev

Configure it to install locally, and then install it:

cd libxml2-dev/
./configure --prefix=/home/peters/perl5/alien/
make
make install

Ignoring all other options like LIBS, INC, and the rest of the stuff that's kindly recommended, you only care about showing Makefile.PL where to find xml2config:

perl Makefile.PL XMLPREFIX=~/perl5/alien/

And then it should cleanly make.

YATOP5R (y a thought on Perl roadmap) [rewritten]

You propably seen that rant as well as what caused it. I'm neither core dev nore have 20 Modules on CPAN, but I have talked to lot of people online and in person over the years.

Revitalizing the Perl Power Tools

I've started revitalizing the Perl Power Tools. I love this project, also known as the Unix Reconstruction Project, but there's been a some bit rot and I think we can make it easier to find. Googling "PPT" means so many other things, including PowerPoint. I've always had a hard time finding it, and I know it's there! Many of the links to it are dead or buried, and when I talk about it (such as in my Stackoverflow post about paste or my lightning talk at the Swiss Perl Workshop).

Toolbag with power tools

Some of these programs date back to the 1990s and I've discovered weird syntax things that Perl 5.22 won't support. Did you know that you could %hash->{$key} with a normal hash? Not after v5.20 you can't! Also gone is defined( @array ).

Dana Jacobson already fixed a bug in the factor program, which now has tests.

Thoughts on craftmanship


Not specifically about Perl, but I did write a post this week about the software development business in general over on my Other Blog.  Might be worth checking out if you want to listen to me ramble on for a bit on that topic.

Pittsburgh Perl Workshop 2014 Call for Talks

The Pittsburgh Perl Workshop Organizers are happy to announce our 7th annual event this November 7th through 9th in downtown Pittsburgh, PA. Our web site is now live and accepting registrations. We are also accepting talk submissions through September 26th:

http://pghpw.org

Thanks to Mark Jason Dominus and Tom Christiansen for volunteering talks for PPW already. And thanks to Infinity Interactive for covering the costs for John Anderson to come to PPW and teach our famous “From Zero to Perl” class on November 7th *at no extra charge* for anybody buying a ticket to PPW.

How does <email>@cpan.org work?

In the recent year I notice more and more instances that mail to ribasushi@cpan.org is silently swallowed. I know this because I communicate with the senders through other channels, and I've even received forwards of copies of emails which as far as the sender is concerned are delivered. I am also increasingly hearing the same story from my PAUSE-peers. Bottom line: it seems that the SMTPD cpan.mx.develooper.com is configured to do rather aggressive *silent* spam filtering.

I am writing this for 2 reasons:
  • I want to gauge whether the problem is indeed pervasive, or it is just bad luck on my part.
  • I want to solicit opinions on how to properly fix this if it is indeed a large-scale problem.

I personally would prefer to get all my mail forwarded my way directly, unfiltered and I would deal with it however I deem appropriate. Of course there are bound to be differing opinions on this.

Anyhow - please share your experience, both positive and negative!

Cheers

2014 Swiss Perl Workshop redux

The Swiss Perl Workshop did not disappoint, although as a featured speaker there was plenty to worry about. One of the organizers, Matthias Bloch, was well trained to take care of the chaotic situation of herding cats and programmers. He was a trained primary school instructor, in which he explained the getting a group of first graders to do anything is much harder. I'm dubious, having been to many workshops, but everything went well. The trick is to embrace the fear.

Matthias Bloch

Some new MetaCPAN features

Perlybook integration: Each pod page and each release page now have two additional links to download MOBI and EPUB version of the current pod or the combined pod of the whole distribution.

The CPAN Author dashboard (can be reached from the 'Lab') now lists all of the distributions of the currently logged in CPAN author providing some overview of all the distributions.

The right panel can be now hidden (and then shown again) giving more real-estate for the documentation. Especially useful for smaller screens. This is persistent in the browser, but currently only works on the POD pages. This feature is also, still under discussion. Your feedback would be valuable!

You can now change the number of items shown on each result page. See the buttons
at the bottom of the search result pages. This choice is persistent in the browser.

Special Meta searches This is not new, but I only found out about these recently after writing how to
Find all Plack Middleware or Perl::Critic Policies.

Oh and something totally unrelated. I started to write an explanation about CPAN for users, contributors, and module authors.

If your core perl documentation uses =encoding, please test the new perldoc release

I'm here today to talk about the venerable perl documentation tool perldoc. Working with Koichi KUBO, I think I have a perldoc which works effectively with encodings in files like perlop, perlfunc and perlvar.

Preliminary results with the Japanese docs have been pretty successful, but it would be nice to get some positive results with other encodings/languages. So if you use a Perl with core documentation that isn't "plain old ASCII", would you please give Pod-Perldoc 3.24_01 a spin in your environment?

If you accept this task, please email results to bug-pod-perldoc at rt.cpan.org, open a github issue, or comment here.

Thanks!

Invite Me (Virtually) To Your Next Perl Meetup

Earlier this week I gave a presentation to the Boston Perl Mongers via Google Hangouts. This was the first time that I've done a presentation remotely, but everything worked flawlessly[1].

I would love to do more of these. If your local PM group or team at $work would like to learn more about static analysis with Perl::Critic, or dependency management with Pinto please get in touch with me. I am thaljef@cpan.org.

I'm looking forward to hearing from you!


[1] Big thanks to Tom Metro for extending the invitation, and Rick ... for handling the technical setup.

Padre is now on Github

Perhaps you remember Padre, The Perl IDE. It was started around 5 years ago, had a lot of development, and ended up being a quite decent programmer's editor.

Alas it's been suffering from lack of care for a couple of years now. Not because of lack of need or interest, but because nobody seems to have the time. And perhaps somebody needs to step up and grab the torch. Perhaps it's you?

Learning Perl 6 - Find in a Large File

Currently I feel it is good to prepare for Christmas.

To read in a larger file, /usr/share/dict/words in my case, I do
my @dictionary = split /\n/ , slurp '/usr/share/dict/words';
That is a cool piece of short code for the task. But - this is slow because I run a regex across a large file, I am told. Also, it is unnecessarily lots of code for the task. Look at that:
my @dictionary := '/usr/share/dict/words'.IO.lines;
Wow. But also, that was slow a few hours ago. It has become much faster since. (Don't tell anybody, the trick was going to a Perl Workshop and talking to some people. Nice people, and very, very helpful. I am tempted to some day try and run a hackathon for them..) Next task was searching for lines containing a $search_string:
for @dictionary -> $line {
      if $line ~~ m/$search_string/ {
          say "match: $line";
      }
}
Looks pretty straightforward but is programming Perl 5 in Perl 6. Brrr. ;-)
say @dictionary.grep({m/$search_string/});
!!!

Platform as a Service Shootout

Tonight we are having a Platform as a Service shootout at MadMongers. The contenders are Docker, Heroku, Stakato, dotCloud, and OpenShift. Hope to see you there.

[From my blog.]

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.