Perl

Improving libwww-perl

published on
You may have noticed that WWW::Mechanize has seen some releases over the last couple of months. No big, breaking changes, but bugs have been fixed and enhancements have been shipped. This module is part of the libwww-perl ecosystem and also a part of the libwww-perl GitHub organization, to which I now also belong. I started pestering people to get involved because these modules, although quite important in the CPAN scheme of things, aren’t really on a regular release cycle. Read More...

Don’t Forget about URI::Heuristic

published on
Imagine you’ve got some user input that is supposed to be a valid URL, but it’s user input, so you can’t be sure of anything. It’s not very consistent data, so you at least make sure to prepend a default scheme to it. It’s a fairly common case. Sometimes I see it solved this way: This converts example.com to http://example.com, but it can be error prone. For instance, what if I forgot to make the regex case insensitive? Read More...

How to Get a CPAN Module Download URL

published on
Every so often you find yourself requiring the download URL for a CPAN module. You can use the MetaCPAN API to do this quite easily, but depending on your use case, you may not be able to do this in a single query. Well, that’s actually not entirely true. Now that we have v1 of the MetaCPAN API deployed, you can test out the shiny new (experimental) download_url endpoint. This was an endpoint added by Clinton Gormley at the QA Hackathon in Berlin. Read More...

Easy Perl OAuth Integration with Runkeeper and Spotify

published on
I’ve been tooling around with a fun little app that I’m building on evenings and weekends. As part of that work I figured I’d let users authenticate via Runkeeper. Luckily Runkeeper uses OAuth2 and it’s all pretty easy to get going with. I’ve published my very small contribution as Mojolicious::Plugin::Web::Auth::Site::Runkeeper On a similar note, earlier this year I also released Mojolicious::Plugin::Web::Auth::Site::Spotify If you’re already using Mojolicious::Plugin::Web::Auth, then these modules will make it trivial for you connect with the Runkeeper and/or Spotify web services. Read More...

HTTP::Response may have a different definition of success than you do

published on
This has bitten me before, so I thought it was worth writing about. This RT ticket explains it better than I can, but let me sum things up here. Consider this code: 99 times out of 100, this will do what you mean. Occasionally it doesn’t. What is the definition of success? In this case it means that there’s an HTTP response code in the 200s. Q: What happens if you’ve gotten a 200 response code in the server headers but (for example) there’s a problem with the response body? Read More...

Upgrading Business::PayPal::API

published on
I got co-maint on Business::PayPal::API about 3 years ago in order to patch one line that was throwing a warning. The previous release had been 2 years prior to that. So it’s fair to say that this module has not lately been on a rapid release cycle. It’s still in use, though, and lately there has been some activity on rt.cpan.org related to it. So, I finally took an evening to sit down and try to cut a new release. Read More...

Stop Writing Your Own Commify Functions

published on
Writing your own commify function may well be right up there with writing your own web framework or templating system. Most of us have done it and it probably wasn’t worth the effort. Enter CLDR::Number. (I should note here that it’s not obvious from the name that this module will commify for you – that’s one of the reasons I’m writing this up.) Let’s see if we can do this: Read More...

On the status of HTTP::BrowserDetect

published on
One of the first modules I ever took over on CPAN is the venerable HTTP::BrowserDetect. I remember I was giving a talk at Toronto PerlMongers one night about a UserAgent parser I had worked very hard to build. When I was finished, one of the comments was “Why didn’t you just use HTTP::BrowserDetect”? The answer was pretty simple – I just didn’t know about it. After I got familiar with HTTP::BrowserDetect, I saw that it was on some levels better that what I had written, but that it needed some love. Read More...