Month: April 2012

Perlbuzz news roundup for 2012-04-30

April 30, 2012 Code craft, CPAN, Perl 5 No comments

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

  • In case you have a burning need to use ಠ_ಠ for warnings/errors: (
  • Expanded the “More Tools” page of the ack website: ( Help your users by including alternatives for them to choose from!
  • YAPC::NA is NOT sold out. Still 30 tickets left. Sign up now! (
  • Before you send a patch, send an email (
  • For want of a newline (
  • Use the command “perldoc -q whatever” to search the Perl FAQ for “whatever”
  • Perl 5.16.0 is coming soon, probably early May (
  • Regexp::Common has regexes for just about everything. Check there first. (
  • Is Try::Tiny still the best choice for exception handling? (
  • Using named regexes in ack output (
  • Automating gov’t websites w/WWW::Mechanize + HTML::DOM (
  • Using Moose’s “lazy” attribute for caching (

Before you write a patch, write an email

April 27, 2012 Community 3 comments

(Originally posted to my non-Perl blog)

I often get surprise patches in my projects from people I’ve never heard from. I’m not talking about things like fixing typos, or fixing a bug in the bug tracker. I’m talking about new features, handed over fully-formed. Unfortunately, it’s sometimes the case that the patch doesn’t fit the project, or where the project is going. I feel bad turning down these changes, but it’s what I have to do.

Sometimes it feels like they’re trying to do their best to make the patch a surprise, sort of like working hard to buy your mom an awesome birthday present without her knowing about it. But in the case of contributing to a project, surprise isn’t a good thing. Talking to the project first doesn’t take away from the value of what you’re trying to do. This talking up front may even turn up a better way to do what you want.

There’s nothing wrong with collaborating with others to plan work to be done. In our day-to-day jobs, when management, clients and users push us to start construction of a project before requirements are complete, it’s called WISCY, or Why Isn’t Someone Coding Yet? As programmers, it’s our job to push back against this tendency to avoid wasted work. Sometimes this means pushing back against users, and sometimes it means pushing back against ourselves.

I’m not suggesting that would-be contributors go through some sort of annoying process, filling out online forms to justify their wants. I’m just talking about a simple email. I know that we want to get to the fun part of coding, but it makes sense to spend a few minutes to drop a quick note: “Hey, I love project Foo, and I was thinking about adding a switch to do X.” You’re sure to get back a “Sounds great! Love to have it!” or a “No, thanks, we’ve thought about that and decided not to do that”. Maybe you’ll find that what you’re suggesting is already done and ready for the next release. Or maybe you’ll get no reply to your email at all, which tells you your work will probably be ignored anyway.

I’m not suggesting that you shouldn’t modify code for your own purposes. That’s part of the beauty of using open source. If you need to add a feature for yourself, go ahead. But if your goal is to contribute to the project as well as scratching your own itch, it only makes sense to start with communication.

Communication starts with understanding how the project works. The docs probably include something about the development process the project uses. While you’re at it, join the project’s mailing list and read the last few dozen messages in the archive. I can’t tell you how many times I’ve answered a question or patch from someone when I’ve said the same thing to someone else a week earlier.

Next time you have an idea to contribute a change to an open source project, let someone know what you’re thinking first. Find out if your patch is something the project wants. Find out what the preferred process for submitting changes is. Save yourself from wasted time.

We want your collaboration! We want you your help! Just talk to us first.

Perlbuzz news roundup for 2012-04-23

April 23, 2012 Code craft, CPAN, Perl 5 No comments

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

Perlbuzz news roundup for 2012-04-16

April 16, 2012 Community, CPAN, Perl 5 No comments

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

  • K=R=P (Kindness = Repeat business = Profit) says @tom_peters. I say that for open source, K=U=G+S, Kindness = Users = Growth+Success.
  • You probably don’t want to be using use_ok() (
  • Interpolate, concatenate or join? (
  • Quick-n-dirty tool to send messages to HipChat (
  • Painless RSS processing with Mojo (
  • RT @chromatic_x If you use SQLite for your CPAN distribution’s tests, consider an in-memory database. Helps parallelism/Reduces disk IO.
  • Explaining web programming via Plack (
  • Common Perl pitfalls (
  • Test::WWW::Mechanize adds scraping functions (

Test::WWW::Mechanize adds scraping functions

April 13, 2012 CPAN No comments

The new 1.40 release of Test::WWW::Mechanize adds functions to help scrape text from your HTML as you test it. This should make things much easier for your integration test of your web apps.

For example, if you want to make sure that this shows up:

<h1>My awesome page!</h1>

then you can add an id attribute to the <h1>

<h1 id="pagetitle">My awesome page!</h1>

and your test can check for it:

$mech->scraped_id_is( 'pagetitle', 'My Awesome Page!' );

Two other functions are added to help in your text extraction: ->scrape_text_by_id() and ->scrape_text_by_attr().

Will these functions help your testing? Do you have other methods that you use to aid testing? As always, I welcome your feedback.

Perlbuzz news roundup for 2012-04-09

April 9, 2012 Code craft, Community, CPAN, Perl 5, Perl 6 No comments

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

  • The Perl Unicode cookbook (
  • bdfoy’s got some ideas for code (
  • How @rjbs spent his Perl QA Hackathon (
  • The homepage for ack is completely redesigned. Hooray for open source, making up for my lack of design skillz. (
  • Tricks to compiling mod_perl 2 to OS X Lion (
  • Have you seen perl-reversion? (
  • Using WWW::Mechanize and mech-dump to get my scratchy 45s (
  • DBD::Firebird releases v1.0 (
  • Recap of the Perl QA Hackathon (
  • Reading about what people are working on = happy. (
  • Whatever task you have, it’s probably already on CPAN (
  • The Perl Foundation wants to give you money to work on Perl (
  • More niche modules, “incredibly useful for about 5 people on earth”: (
  • Did you know prove has –shuffle to run tests in random order? Has randomizing tests uncovered bugs for you?
  • MetaCPAN has a new logo (
  • RT @dukeleto This is a huge step forward in #perl dependency management: “carton bundle” support! (
  • RT @aaronlerch Some devs think “I’ll just copy and paste this code block.” Now you have two problems. Now you have two problems.
  • Would love to see this Perl::Critic talk (
  • “The Python site talks about the value the reader gets out of Python, while the Perl site talks about Perl” (
  • How to get ahead in open source: Wear sunscreen. (
  • Help Open Source Bridge select session proposals (
  • MetaCPAN at the QA hackathon (
  • Perl Foundation helps fund critical Perl 5 dev (

Using WWW::Mechanize to get my scratchy 45s

April 4, 2012 Uncategorized 3 comments

I’m a big fan of WFMU’s Beware of the Blog. So much music geekery and arcana in one handy source!

Sometimes there will be a post with lots of MP3s for download, like this one today with long-forgotten 45s of songs paying tribute to Merle Haggard. I don’t want to listen to the mp3s in my browser, and I don’t want to manually do the Save As dance in the browser.

Perl and WWW::Mechanize to the rescue! If you have WWW::Mechanize installed, you also have the mech-dump utility. mech-dump started as a tool to make it easier to create WWW::Mechanize programs by showing what form fields exist, but it does more than that. By default, mech-dump will fetch a page and display the forms and fields on the web page. If you call it with –links, you’ll only get back the links, like so:

alester:~ $ mech-dump --links
... etc ...

Filter that output through grep and pass it to xargs and wget, and you’ve got a handy MP3-only downloader.

alester:~ $ mech-dump --links [big URL] | grep mp3$ | xargs wget
--2012-04-04 09:27:32--
100%[=======================================================>] 4,935,323   4.08M/s   in 1.2s
... etc ...

I suspect very few Mech users are aware of mech-dump, and how handy it can be from the command line. I wish I’d done a better job of publicizing it.

Perlbuzz news roundup for 2012-04-02

April 2, 2012 CPAN, Perl 5 No comments

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

  • “The measure of a civilization is how it treats its weakest members.” So too it is with how an open source project treats its newbies.
  • A recap of the Israeli Perl Workshop 2012 (
  • Who is a contributor to Perl? (
  • RT @OvidPerl Perl version 5.15.9 has 521,047 tests all of which just passed. #software #testing #tdd #perl
  • Perl-based search engine DuckDuckGo is taking off: (
  • Discounts on bulk orders of Modern Perl for user groups (
  • New beta version of HTML::Lint validates HTML entities (
  • The two most premature optimizations: Optimization of non-working code, and of unmeasured code. (
  • Devel::Cover reports in vim (
  • Syntax coloring in the debugger (
  • How to install BerkeleyDB (
  • What I learned teaching Perl for advocacy (