Friday, March 3rd, 2006 – Using Ajax from Perl

Category: Ajax, Perl

From the O’Reilly site, there’s a new article talking about a simple, quick way to enable Ajax usage inside of Perl, with the help of a module from CPAN.

If you’re even remotely connected to web development, you can’t have failed to have heard of Ajax at some point in the last year. It probably sounded like the latest buzzword and was one of those things you stuck on the “must read up on later” pile. While it’s definitely a buzzword, it’s also quite a useful one.

In short, it’s about making your web pages more interactive. At the core, Ajax techniques let you update parts of your web page without reloading the whole page from scratch. This enables some very cool effects.

When you log in to Flickr, you can see the photos that you have just uploaded. Behind the scenes, Flickr uses JavaScript to make a separate call back to the server to update the details. It does so by using something called XMLHttpRequest. You’ll hear a lot about this as you explore Ajax.

They continue on, explaining a bit more about what Ajax is and how it’s used before getting into the actual usage of it. They show you how to grab the Perl module, CGI::Ajax, from CPAN and help you create a sample introductory application – a username checker. They wrap it up with a look at how Ajax is used in the “real world”, and note that there are times to use it and times to push it aside, depending on the app.

Posted by Chris Cornutt at 8:01 am

3.6 rating from 35 votes


Comments feed TrackBack URI

I love Perl, but Ajax from a CGI script and the example uses a flat file? Yikes! Is this Ajax circa 1995?

Comment by Douglas Clifton — March 4, 2006

It’s not exactly totally up-to-date (or written in ruby ;-), but it’s simply a good way of enhancing stuff that might well be lying around already. It’s a good way of bringing old systems up to date without too much trouble.

There’s a lot of people out there who know a little bit of CGI, and this is a relatively simple way of getting them introduced to Ajax.

-Dom (disclaimer: I wrote the article)

Comment by Dominic Mitchell — March 4, 2006

Perl and AJAX that’s a good combination :)

Comment by gkumar — March 9, 2006

I programe most of the time with Perl, but when I go for Ajax, I prefer Php Ajax, it is more flexible.

Comment by Sophal Cjam — April 11, 2006

PERL generates HTML content (array of images)
AJAX from a .js script is to download them one at a time

AJAX does not work from client browser when web page is rezult of a PERL “print (@template);” command.
If the source of above genrated page is copied to an .html file and downloaded from same web site, AJAX does its job.
rgds Emil

Comment by emilstamatoiu — September 12, 2006

Leave a comment

You must be logged in to post a comment.