Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

perrin (4270)

perrin
  (email not shown publicly)

Perrin is a contributor to various Perl-related projects like mod_perl, Template Toolkit, and Class::DBI. He is a frequent speaker at OSCON, YAPC, and ApacheCon, and a contributor to several perl-related books.

Journal of perrin (4270)

Thursday June 29, 2006
03:37 PM

YAPC Chicago wrapup

I'm back from YAPC. Michael (Peters, my colleague at Plus Three) is off at ApacheCon giving his talk there. I think he's actually done by now, since he basically had to go from the plane straight into the conference.

It was a big one this year. There were about 400 people there, and I got see lots of old friends and made a few new ones.

Mark Jason Dominus gave another talk based on his upcoming "red flags" book, about fixing bad style. He dissected a module by Chris Winters, which made for an interesting talk because Chris writes good code to begin with. I definitely want this book when it comes out.

Andy Lester gave an entertaining talk called "Get Out of Technical Debt Now!" The focus was on postponed "# TODO" and other tasks and how to
manage them.

I went to a talk on Perl::Critic, which I plan to start using (maybe in my "Low Maintenance Perl" talk at OSCON), and another on B::Lint and how to customize it. Lint looks challenging, so I'll try Perl::Critic first.

The Perl 5.10 update included some good news about speeding up regexes and eliminating some conditions where a regex would run forever on a large chunk of text. I'm personally not very excited about additions the defined-or operator ("//"). When I was a kid, we had to check for defined uphill, both ways, in the snow.

My favorite testing talk was the one on Selenium. This is the project for running a browser to test your JavaScript, which now has a Perl module with an API that looks easy to use from Test::More. (Possible project: a WWW::Mech compatibility layer.)

There was some buzz about a new OO module called Moose, which is somehow a product of some Perl6 work. I couldn't quite figure out the point of it in the 20 minute presentation, but Randal and Audrey and some other people seemed excited about it.

Tatsuhiko Miyagawa (now of Six Apart) gave a couple of interesting talks. (He gave more, but these are the ones I saw.) One was on Plagger, a tool for doing things with RSS. It had
all kinds of plugins for turning various things into feeds, filtering them, and generating different kinds of output. There's an example at
http://planet.yapcchicago.org/.

His other one was a lightning talk on XML::Liberal, which is a module for parsing the broken XML that most RSS feeds have in them. It corrects all the problems before passing it to XML::LibXML and it has no performance penalty on XML that is not broken. This could be very useful.

There was a good Subversion talk by one of the book's authors, but not too much to take away from it that I didn't know. One thing I learned
is that work is being done on merges that track what you've already merged. I make use of branches and merging quite a bit, so this could be helpful. Also, there is a way to mark individual files as requiring a lock before working on them, which can be handy for large binary files.

On the last day, I went over some new code for Apache::SizeLimit with Dave Rolsky and then caught some of MJD's Higher Order Perl talk.

The lightning talks were the usual mixed bag. Audrey Tang presented a brilliant one, which I believe was written by someone else at
YAPC::Asia. When video becomes available, watch
it. Jeff Bisbee showed JavaScript::XRay, a very useful-looking module for essentially tracing JavaScript execution in a frame. There was the
usual in-joke movie too, which was particularly good this year.

Slides for most of these talks are here:
http://yapcchicago.org/wiki/index.cgi?YAPCSlides

And I'm sure you're all wondering how Michael and I did. I got some good laughs with my lightning talk on Web 2.0 and I was pleased with it. Michael had a packed house for his AJAX talk (adding AJAX features to the Krang CMS), and did a great job. Several people told me later that his was a favorite of theirs at the conference.

Thanks to the hard-working organizers who pulled off a great event.

Friday April 28, 2006
02:06 PM

how large sites scale their databases

I've been following Tim O'Reilly's series on how large sites scale their databases. Also, this article about topix.net. They seem to fall into two camps:

  1. Using flat-files, typically accompanied by lots of attitude about how much smarter they are for not using an RDBMS and frequent invocations of Google.
  2. Using MySQL, with replication to scale reads, and data partitioning to scale writes (users A-H on this cluster, I-P on that one...)

Amazingly, Craig's List uses MyISAM tables. I guess it's nearly all reads, but I just didn't think the locking approach used for MyISAM tables would hold up to traffic like that. A primary reason why I use InnoDB is the row-level locking and the multi-version concurrency system, which means that readers don't block writers.

Two interesting things here are that none of them use PostgreSQL, despite a few of them being fairly new, and that none of them have tried commercial offerings for database clustering, like the stuff IMB and Oracle sell.

In fact, I've never met anyone who had tried the Oracle or DB2 clustering. Even the people who have the money seem to avoid it. Can anyone offer any personal anecdotes about it? Does it work at all?

Wednesday April 26, 2006
03:10 PM

Test::WWW::Mechanize tricks

Sometimes I want to test if my application sent the right redirect, but I don't want to follow it. It might be to a page that isn't accessible from my dev system, or is hosted by someone else and I don't want to hit it every time I run the test suite.

To do this with Test::WWW::Mechanize, I use this code:

my $mech = Test::WWW::Mechanize->new(autocheck => 0);
$mech->requests_redirectable([]);    # don't follow redirects
$mech->get($uri);
is($mech->status, 302);
$mech->content_contains($url_to_redirect_to, 'sent to correct URL');

Another thing I want to check is if the request set a cookie. A simple way to do that:

my $resp = $mech->get($uri);
ok($resp->header('Set-Cookie'), 'has cookie header');
like($mech->cookie_jar->as_string(), qr/$COOKIE_NAME/,
     'cookie was accepted');

Since the LWP cookie handling does the same checks that browsers do for domain and path, this can help catch problems with your cookie headers.

Thursday March 09, 2006
03:00 PM

love the new CPAN search!

[ #28939 ]

It's been in beta testing for a while, but now it's live. Now I can type in "DBI" and the DBI module is at the top of the results! I used to have to dig for it. Same for CGI. It's much faster too. Swish-E, the search engine behind it, has been great on the projects we've used it on, and I'm glad to see it powering CPAN now.

Not sure if this was Graham Barr or Ask Bjorn Hansen or someone else, but whoever it was, thank you! This is a great improvement for CPAN search.

Wednesday December 21, 2005
07:38 PM

Bruce Eckel on Perl, Java, Python, and Ruby

This article by Bruce Eckel discusses the book "Beyond Java" by Bruce Tate, in which Tate discusses Ruby on Rails and a few other things. For those who don't know, Eckel is the author of one of the most popular Java books ever, "Thinking in Java."

The article is full of good quotes and has a fun snarky attitude to it. I will warn you now, he doesn't like Perl. However, he does recognize that Perl brought something important to the table, and it's nice to read a piece by someone with a little more cool-headed view of the Java vs. Ruby showdown that is filling oreillynet.com these days.

Here are some choice quotes:

...almost at the end of the book he declares that he doesn't have time to learn these other languages in any depth -- although he has no trouble condemning the same languages in his rush to Ruby.

Ruby is to Perl what C++ was to C.

The backlash from heavyweight web frameworks has been significant. We now know that EJB 1 & 2 were based on an entirely flawed set of use cases.

I think we've mostly been hearing from people who have come from Perl and found Ruby to be a "better Perl, with objects that work," or people who are finally convinced that dynamic languages have merit, and so mix the enthusiasm of the first time dynamic language user (quite a rush, as I remember from my 2-month experience with Perl many years ago) with their experience of Ruby.

Wednesday October 26, 2005
10:49 AM

Did you know that Ruby invented MVC?

[ #27319 ]

From an interview with Bruce Tate, author of some O'Reilly Java books:

Siddalingaiah: Ruby on Rails is known for its rapid Web application development, but there others, such as PHP. The PHP community has developed mountains of opens source Web applications. Do you think PHP developers have something valuable to contribute?

Tate: Not really. PHP, and the ideas behind it, have been around for a while. It's quick and dirty. We know quick and dirty. Visual Basic. PHP. Perl. They don't excite me. Now, quick and clean, that excites me. Ruby on Rails is model-view-controller. It stretches the object-relational-mapping state of the art. It's quick and clean.

Well, I'm glad we cleared that up. You guys writing MVC apps with OO PHP5 and Perl can all go home now. (The idea that ActiveRecord somehow stretches the O/R mapping state of the art is pretty amusing too.)

Wednesday October 19, 2005
11:59 AM

Rails cheerleaders: go easy on the hyperbole

This is from the first page of the latest Ruby on Rails article on the O'Reilly website:

"In this short time, Rails has progressed from an already impressive version 0.5 to an awe-inspiring, soon-to-be-released version 1.0 that managed to retain its ease of use and high productivity while adding a mind-boggling array of new features."

Come on! I don't know Curt Hibbs, and I have nothing against him, but this intro is positively ludicrous. How is this supposed to be "awe-inspiring?" Does he think that before Rails we had no object/relational mappers, no code generation, no MVC, no test scripts, no dynamic languages? You'd have to ignore an awful lot of web development tools (that pre-date Rails) to think that.

But he does seem to think that. A little further down the page he says this:

"The typical development cycle for testing a change to a web app has steps such as configure, compile, deploy, reset, and test."

In what world is that "typical"? The only web development tool in use these days with a compile step is Java, and if you look at web development as a whole, there are more people NOT using Java than using it.

It's also not a very accurate list. Even Java apps don't require reconfiguration every time you change your code! And Rails doesn't remove the "test" step.

Most of the writing about Rails that I've seen seems to have blinders on when it comes to anything other than Java. It would be nice to see some acknowledgment that other dynamic languages already have this stuff, and a little more touch of reality in general. The current tone smacks of ego and arrogance. I don't see anything wrong with trying to draw in Java converts, but if the plan is to just ignore PHP, Perl, and Python, they're losing out on an awful lot of potential allies.

Thursday July 28, 2005
10:50 AM

Damn you, Google

Telling people things like this is going to cause lots of pain for people like me. It's easy to say everyone should use proprietary features and make 18 different versions of their site to work with all the browser and OS combinations out there when you have a huge staff of great JavaScript people and a QA lab with every platform set up. Most web developers don't have these things. Now, thanks to successful projects like Google Maps, clients will think this is a reasonable thing to expect from web developers. Wait until they see how much it costs to develop and test all those different versions... Wait until they see how much it costs to maintain them...
Wednesday July 06, 2005
03:51 PM

YAPC::NA 2005: Pleased to meet you

The best thing about conferences is getting to meet people who I'm on mailing lists with but have never seen in person. Some of them are people I've "talked" with, some are lurkers, some are talkative on lists where I'm mostly a lurker. Regardless, it's always great when someone walks up and says "Hi, I know you from the ____ list and I just wanted to say hello in person."

So, to all those people who did just that at YAPC, thanks, and pleased to meet you.

Wednesday May 18, 2005
12:05 PM

a plea to Module::Build users

I'm asking all Module::Build users to please use the "traditional" option to create_makefile_pl so that their work will be more compatible. Full explanation in my PerlMonks post.