This is a shot of the Distance Education Room 235 in the Pyle...



This is a shot of the Distance Education Room 235 in the Pyle Center where some of the talks for YAPC::NA 2012 will take place.

Making RESTful Dancing easy with Dancer::Plugin::REST

An useful plugin for writing RESTful Dancer web applications is Dancer::Plugin::Rest by Alexis Sukrieh, available at https://metacpan.org/module/Dancer::Plugin::REST.

To use it when defining routes, easily:


package MyApp;

use Dancer;
use Dancer::Plugin::REST;

This exports the resource keyword, which can be used as such:


resource camel => (
create => sub {},
get => sub {},
update => sub {},
delete => sub {},
);

This automatically creates the following route handlers:

  • post /camel (create)
  • post /camel.:format (create)
  • get /camel/:id (read)
  • get /camel/:id.:format (read)
  • put /camel/:id (update)
  • put /camel/:id.:format (update)
  • del /camel/:id (delete)
  • del /camel/:id.:format (delete)

The format param can be used in requests such as


GET /camel/larry.xml

Next to that, this module exports a whole bunch of error handler methods, such as

  • status_unauthorized
  • status_ok
  • status_length_required
  • status_not_found
  • status_forbidden

which can be used to make life easier:


return status_unauthorized("Not Larry") unless $user->is_larry;

Logging wide characters with Log4perl

I gave my "Surviving Perl Unicode" tutorial at the Mad Mongers this weekend. After I mentioned Test::Builder's Unicode issue, JT Smith asked how I would silence wide character warnings from Log::Log4perl. I'd never really thought about it.

For instance, here's an easy program that wants to output U+2020 (ᴅᴀɢɢᴇʀ):

use utf8;
use strict;
use warnings;

use Log::Log4perl qw(:easy);
Log::Log4perl->easy_init( level => $DEBUG );

DEBUG( 'Is this a † I see before me?' );  # warning

I get this warning:

MetaCPAN August Roundup

August was another busy month for MetaCPAN, so I think a recap is in order. I'll proceed chronologically.

2011-08-01

Gabor Szabo included MetaCPAN in his first issue of the Perl Weekly. It's an excellent aggregation of all Perl things blog and newsworthy. I can tell you just from the time involved in a MetaCPAN recap that Gabor is spending a huge amount of time on his weekly newsletters. I follow a lot of blog posts, but I find his weekly recap helps me find interesting stuff I may have missed.

2011-08-03

Madison Children's Museum

Madison Children's Museum :

If you think you might bring your kids with you to Madison and make a vacation out of your trip to YAPC, then one thing you have got to see is the Madison Children’s Museum. They have amazing hands on demonstrations, art projects, and fun activities. At only $8 per person for a whole day, it’s an inexpensive way to have some fun with the family.

On Unicode and Sorting

Tom Christiansen published an article on Perl.com on the topic of sorting and unicode.

It's good and it explains a little bit about why Unicode is so difficult and why sorting Unicode (or even ascii) is even more difficult, mainly because it depends on your local definitions what results you expect from a sorting operation.

It might be nice to point out that the modules he proposes on using, Unicode::Collate, and Unicode::Collate::Locale, have been in core perl since 5.8 and 5.14, respectively.

Happy sorting!

CPAN Testers Server Failure

Unfortunately the CPAN Testers server has a failing hard disk, which is only allowing READONLY mode access. As such, all CPAN Testers operations are now failing.

The host company has confirmed that ...

a) our disk has a fault
b) we don't have a second RAID disk (even though we're paying for it!)

As such to replace the disk it requires complete data loss!

As you might anticipate this is not making me happy today. I had already started making plans to migrate to a new server, but to do this gradually over the next month. However, it looks like this will need to be sped up.

As things stands the CT server is effectively out of action. I have read access, but will need to wait until the new server is ready before I can copy over everything as it currently stands. Although I have several backups of data, I would rather avoid rebuilding the complete set of data files.

Method::Signatures::Simple 1.01 released to CPAN

I’m pleased to announce version 1.01 of Method::Signatures::Simple. It provides a little sugar for writing methods and functions. Chip Salzenberg requested the addition of a function keyword with the same signature processing, and kindly provided me with the implementation (on github).

Here’s some example code from the synopsis:

Dyn Has 2 New Perl Positions

Dyn Has 2 New Perl Positions :

If you’re in the Manchester, New Hampshire area, or are willing to move, then Dyn has two great new Perl positions available:

They’ve also still got a position open for a Backend E-Commerce Developer.

And if you’re in San Francisco or London, they also have junior and senior system administration positions open, which require Perl knowledge. 

Padre 0.90, the Delayed Release Announcement

Normally when Padre, the Perl IDE is released, we like to let people know about it through the release announcement. It serves a dual purpose. it both lets us acknowledge the awesome work that goes into Padre while letting everyone out there see what has changed, what has been fixed and where we are in terms of the project and whether or not it's ready for your use, or to upgrade.

0.90 was released with little fanfare, so I'd like to take the time now to cover off some of the changes in Padre 0.90 in a little more depth.

OK, so I can't help myself here, but with the work done by Ahmad Zawawi to bring us a modern Scintilla with the Wx::Scintilla package, we now get squiggles!

Kickstarting the Gitpan

If you've played with Gitpan at all, you probably have an idea of how cool this project is. The idea behind Gitpan is to take all of CPAN and make it available as Git repositories which are tagged by release. It's a great idea. It makes it trivial for Github (and Git users in general) to create patches for modules which don't already exist in a public Git repo. It's also useful in the case where the original Git repositories for modules on CPAN may no longer easily be found online.

Now, if you've followed the Gitpan project, you probably also know that it is not currently up to date, which is a shame. I contacted Schwern about this recently and he was kind enough to create and tag some issues which are blockers to the resumption of Gitpan.

In Zürich with Damian

For the last two weeks Damian has been here in Zürich teaching classes on Perl and vim. We attendees are having a great time and learning a lot. He managed to give us a lot of information and understanding in a very short time. We also had the chance to ask many questions, which he answered very competently.

For everybody who missed it, come and join us next year! I will keep you posted on that.

Thank You Sponsors!

We’d like to thank our sponsors for stepping up to support us. We really couldn’t do this without their support.

You too could sponsor YAPC.

The UTF8 flag and you

If you are looking at the UTF8 flag in application code then your code is broken. Period.

The flag does NOT mean that the string contains character data. It ONLY means that the string contains a character > 255 either now or could have, at some point in the past.

For strings that contain characters > 127 < 256, you have no idea whatsoever about whether the string contains characters or bytes regardless of what the UTF-8 flag says. (For strings with only characters < 128 there is no difference whether they are ASCII or binary, and strings with any characters > 255, must be either all characters – or corrupt (character and binary data mixed together).)

The following will produce a perfect copy of lolcat.jpg in lolol.jpg:

my $funneh = do { local ( @ARGV, $/ ) = 'lolcat.jpg'; <> };
utf8::upgrade( $funneh );
# now the utf8 flag on $funneh is set!
open my $copy, '>', 'lolol.jpg' or die $!;
print $copy $funneh;

Certification vs. Certificates

I posted earlier today about O'Reilly's Perl Programming Certificates that accompany several of their Perl based courses available now. Because I wasn't completely clear in my understanding of certificates vs. certifications, I used the word certification in describing their offering, when really I should have said certificate.

So what's the difference anyway? Do you get a certificate if you have a certification? If you have a certificate does that mean you are certified? I didn't find a canonical comparison between the two, but this web page seems to have a reasonable comparison between the two. Posting the table here:

Certification

Being anti-social

A few days ago I deactivated my Twitter account and most other social networking accounts. It's not that I'm vanishing off the face of the earth or anything like that - I've just gotten disillusioned with "social" networking. It has grown to be a kind of addiction; I checked Twitter etc. far too often, to the point of it being a distraction, but actually it wasn't a lot of real communication, it was more like people talking at you. I didn't find much "social" value in the whole thing.

I still program Perl for a living, and it'd be nice to see Perl friends, for example, in Frankfurt next year.

About all those CPAN modules - I've looked over the 100+ dists that are under my name on CPAN and have found that most of these I neither use anymore nor do I have any wish to maintain them. Most of them were related to an older work project and are probably not used outside of that.

When you come to YAPC::NA, if you decide to stay at the rooms...



When you come to YAPC::NA, if you decide to stay at the rooms we’ve reserved at the Lowell Center (approximately $100 per night) then you’ll also get breakfast served to you for free each morning in the Lowell Center conference rooms just down the hall from the main lecture hall. We think it’s a super sweet feature to be able to roll out of bed, take the elevator down and get a nice hot breakfast, and then stroll 20 feet down the hall to attend the morning plenary session. 

I should note that if you choose to stay in the dorms, which will be about half the price, you’ll also get a hot breakfast, it just won’t be quite this convenient. 

Catalyst? Really?

I've been so busy doing Actual Work that I've forgotten to write about doing it!

Now that a lot of the modules I'll be using are more or less in place, including my new centralized security where "everything" will go to get permission to do "anything", it's time to start sowing the modified modules together in Catalyst.

Or is it?

I try to code by "Make a plan, and stick to it, unless it sucks."
Figuring out if a solution sucks is part of that, so I've taken a long, hard look at my Catalyst choice here.

Did I really pick Catalyst because it's the best tool for the job, or because it's the weapon I had in my hip holster at the time? Let's see what we're looking at here:

Perl Programming Certificate

Looks like O'Reilly is offering certifications certificates for Perl programming. This is huge, I think they are the first entity to offer something like this.

http://www.oreillyschool.com/certificates/perl-programming.php

Our first sponsor: YAPC::Europe Foundation

When Anton Berezin announced that we Frankfurt.pm hosts YAPC::EU 2012, he handed over a check for over 1,000 Euro from YAPC::Europe Foundation (YEF). Thanks to YEF for this kickstart donation.

YEF exists to promote Perl in Europe. They do this by supporting organisers - not only with donations like we recieved but the also help when organizers have questions about how to handle this or that. And they sponsor the online payment system that can be connected with Act! And the venue committee of YEF elects the hosts of the YAPC::EUs.

During the lightning talks at YAPC:Europe 2011 BooK said that YEF wants to support more workshops, so organisers should ask for help... And of course YEF accepts donations so YEF can support even more events.

yef-scheck-2011.JPG

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.