In many scripts,
we need to prompt the end user for information - this could be a prompt for a file name,
a selection from a list of options,
or an answer to a yes/no question.
The traditional approach to this sort of question is to print your question to STDOUT,
read a line from STDIN,
and apply some sort of parsing to the answer...
At work I recently set up a Jenkins instance to run all our tests whenever someone pushes changes to the master branch of our git repo. And, after changing some stuff in our code that made the perl debugger cry*, I added Devel::Cover to the mix. So now, Jenkins not only notifies us by email whenever someone is naughty and makes the tests fail, it also generates a lovely report of how much of our code is actually tested.
Naturally, the first thing I looked at was how well-covered our tests were. This seems like a bit of a weird thing to do, but it has exposed bugs in the tests themselves. Let me explain just one example.
Purdue's Course Signals provides instructors with an early-warning system for students who are struggling or otherwise in trouble in their courses. And it works! Possibly the coolest piece of educational technology I've seen in quite a while.
I guess the main reason I'm writing this blog post is because I feel guilty about it. There are SO MANY other similar modules.
I wanted to review them all, neilb style. I never found time to do it. Damn you, perfectionism.
I don't want to explain my issues with other modules here. I'm not sure if Lock::File is really much better than others, or if I'm just biased because I used it for years. You can look at Lock::File POD and decide for yourself.
But I finally realised that I have too much unreleased code and I've postponed its uploading to CPAN just because I didn't want to duplicate some existing code. Damn you, perfectionism.
I started writing this as a response to chromatic's post at his Modern Perl blog. Short version: I think that the VM will be no problem for Moe, Stevan Little's new project to bring a Perl (or dialect) to the JVM.
Overall, I think chromatic's points are very good, and I agree with many of them, especially in the "What Moe Could Produce" section.
But I disagree with one point, in that the JVM has (at least to me) proven that it is an excellent platform for hosting dynamic languages. Well, at least one dynamic language.
Just as you can edit a macro in Vim by pasting it to a buffer and editing the pasted text (then yanking the edited text into the macro register), you can create a Vim macro by yanking (J. Random) text into a register then executing that register as a macro.
(This makes it easy to play the home game, "Gee, I wonder what this line noise would do in Vim?")
Galileo is a simple but modern Perl CMS which is totally installable from CPAN. Just a few quick commands and the site is live and usable! The primary focus is small sites, which need immediate availability and easy (no?) administration. All content is written in a markdown editor in the browser and saved live via websockets with no reload.
This morning I released the newest version of Galileo with several improvements that have been in waiting for months. Among the most exciting is preliminary support for in-place database upgrades via DBIx::Class::DeploymentHandler.
In addition, Mojolicious author Sebastian Riedel made an extra effort to ease the testing of JSON messages passed via websockets. This means that Galileo’s two-way communications between the browser and the server are now even more robust and better tested. Further, this move has made unicode handling more reliable (since websocket unicode handling has its own quirks) so I can now say that Galileo should be unicode friendly! Thanks SRI!
After a week of Christmas (the Eastern one) break we are here to continue our weekly newsletters. They will now also appear on the conference site in the News section.
First, a brief statistics update. Today there are 71 registered people coming from 15 countries and 26 monger groups. There are four submitted talks already. And we have some first early bird ticket purchasers. Thanks to all of them.
Today we would like to call for sponsorship.
YAPC::Europe is a non-profit event aimed for those who use Perl in their daily activity (or even on a monthly or yearly basis, checking the crontab settings after migrating to a new server :-) All income comes from attendee fees and from sponsors.
Tomorrow (Tuesday, January 14th), I'll be giving a talk at MadMongers about a new technique for building web-services enabled web apps. It is the core technology we developed to create The Game Crafter, and we now use it in all apps that we develop both internally and for customers. With it, you can build web-services enabled web apps in minutes rather than months, and I'll be demonstrating that live at the presentation. If you are within driving distance of Madison, WI I encourage you to join us. The presentation begins at 7pm at the Essen Haus.
I spent the morning collating the CERT recommendations and rules for secure Perl coding. Some of their policies recommend particular Perl::Critic policies. Here's that list:
Marpa::R2's
Scanless interface
is not yet two weeks old,
but already there are completed applications.
Significantly, two of them are for work.
A JSON Parser
The non-work-related application is
a JSON parser.
Given what it does,
it easily could have been work-related.
(It's been available for a few days as a gist,
so it may well be in production use somewhere.)
It was written by Peter Stuifzand,
runs 185 lines
and took him less than 30 minutes to write.
Peter reports that it was a matter of
typing in the grammar,
and adding a few Perl functions to provide the semantics.
There are, of course, other JSON parsers out there,
many of which run faster.
These, however, took weeks to write.
If you are, for example,
thinking of
extending JSON,
and development time is a major consideration,
the Marpa-based solution will be attractive.
Quite a few updates for this month's summary. New CPAN distributions, plenty of fixes, some updates, lots of discussion ... and 27 over million reports!
I've used cPanel/WHM for a very long time as a personal server manager, and up until recently it's served my purposes pretty well.
However since getting into the Mojolicious framework and a few other Perl modules that require a Perl version greater than the 5.8 that cPanel is currently tied into, it's become a bit of a nightmare trying to run any Modern Perl apps on it.
While there is some Mojolicious documentation around running an app on Apache, I thought I'd document the exact steps I took to get a non-lite app up & running on my Hostgator server (although I'm sure it would work equally well for Dreamhost etc or other shared hosting solutions):
I am not exactly sure if the difference is between Strawberry Perl and Active Perl, but it looks like it is there and I am stuck like the test of the module.
Version 0.03 of AnyEvent::ForkManager has another minor issue, you need to already have Test::Requires, which is then not used, but once you install that module, here is the main point:
While it would be nice if the test were passing, I think it would be also important to understand why are the tests stuck in some of the cases. Is that really some difference between Strawberry Perl and Active Perl?
ps. No, I don't really need this module, but I was smoking CPAN on Strawberry Perl and Christian Walde (Mithaldu) thinks I am just complaining and not doing anything about it.
During the last leg of my new year's vacation, I started hacking on ZMQ::LibZMQ3 et al again, due to gentle prodding from @melo to include zmq_proxy().
What seemed like a simple API addition in the end turned into myself writing a autoconf like "compile, see if it works, and check if a particular API exists" type of too (is there a CPAN build tool change component that does this kind of stuff?). I'm satisfied by the fact that it actually works, but I must say the Makefile.PL for ZMQ::LibZMQ3 is starting to get pretty darn wacky.