New Perl Book Available Online

pudge on 2001-08-09T01:04:59

c_monster writes "My new book Perl for the Web has been published and should be in stores shortly. The full text is also available on my web site. It's all about using Perl to create Web applications with 100% less slowness. There's even a gratuitous mention of Slashcode. Read it. Cherish it. Let me know what you think."


Quickie comments

brevity on 2001-08-10T20:19:12

I just skimmed through the book online this morning; first impressions.

There's a lot of good, generic advice here on how to architect websites. The author does a reasonable job of enumerating the available options and various tradeoffs that must be made.

It's pretty light on code samples and tends to refer to Velocigen products more than anything else. This is okay, but I found out later from a friend that Chris Radcliff is also Chief Evangelist for Velocigen. This fact is not made clear on his website; I hope it is clear on the book jacket.

Suddenly I have to evaluate this book in a whole new light. I find myself trying to see if the less-technical sections are just recast marketing material. Which is regrettable because in general it's a pretty decent book. I think it's fine to use Velocigen examples, it should just be clear that the author works for the company.

This book reminded me a lot of Phil and Alex's Guide to Web Publishing, both in the positive and negative senses.

  • Informal, but informed style
  • Good overview of entire topic
  • Good on architecture in general
  • Good at dispelling Java myths
  • Proposes open source solutions
  • Uses examples which are drawn from the author's company's product, which is related to open source but not free.

This book didn't have nearly as many pictures of dogs though. :)

I would recommend this book to someone who may have knocked together some CGI scripts but wasn't sure how to scale.

Disclaimer; I work for ActiveState, which sells a product which competes with Velocigen in the CGI-acceleration and web services areas. I am *not* speaking for my employer, this posting is *my* idea, no one but me has "approved" this post.

Another quick comment

KM on 2001-08-11T00:07:46

I, for the most part, agree with what brevity said. Although this book isn't in competition with mine, I don't want to seem like a bungholio by putting it down in any way. However, unless I completely missed it, I didn't see any mention of security with Perl/CGI. No mention of tainting (-T), safe system calls, gothcas, etc... Although this wasn't a 'learn to do CGI with Perl' book, per se, it would have been nice to see a section on safe CGI scripting.

errors, errors, lots of errors ... :-(

ask on 2001-08-11T08:00:50

Chapter 10 is filled with inaccuracies about mod_perl.

Two of the bigger ones I noticed were that I couldn't find anything about the many efficient ways to solve the problems with the one to one relationship between Apache processes and mod_perl processes. I have some of them in my talk about it from TPC5, slides at http://develooper.com/modperl/

Another huge mistake is that the book says that mod_perl and Apache are under the GPL license. That's quite wrong; the GPL goes against alot of what the Apache Software Foundation is working for.

The book goes on to describe some of the features of the GPL and what it means for Apache. Uh, D'oh.

Oh, and then it goes on to tell that DBI
"were developed initially by programmers from related projects, and then taken over and implemented by different programmers.". I don't think that is correct. Tim Bunce released v0.01 of DBI.pm and is still the primary developer.

It also tells favorable about Velocigen that it "tracks the age of each file cached in memory, ...". mod_perl can do that too. Optionally of course. The tools people use to built stuff when they use mod_perl, also support caching and there are various tools to do "clustering" too.

Anyway, I gave up halfway through that chapter.
Otherwise it sounds a lot like a "needed book", but it could be a lot better researched and have a lot less blatant errors and omissions. :-( I hope the other chapters are better.

  - ask

 

Re:Quickie comments

c_monster on 2001-08-14T16:35:07

It's pretty light on code samples and tends to refer to Velocigen products more than anything else. This is okay, but I found out later from a friend that Chris Radcliff is also Chief Evangelist for Velocigen. This fact is not made clear on his website; I hope it is clear on the book jacket.

My $.02 and a little explanation:

I am indeed the Chief Evangelist for VelociGen. I tried to keep the book as neutral as possible, but it's obviously going to be affected by my tool of choice. That would have been the case even before I was employed by the company, though. I was a big fan of persistence (who wouldn't shut up about it) and that's why I was hired.

I should mention that the examples, though written in a style that VelociGen natively supports, are meant to be used by anyone on any platform. To this end, I'm frantically working toward publishing a CPAN module to handle PSP embedded Perl files. If anyone's interested in helping me (or getting the half-finished source early), please let me know. I'm hoping to have it posted to the site within the next few weeks.

As a final note, remember that it's me writing this book, not my company. Any inaccuracies or blunders are my fault, because I'm human. I'm working from my own experiences over the last 6 years, so I'm bound to have forgotten or misremembered something along the way. Please feel free to correct me, and I'll add the correction to the copy on my site.

Thanks,
Chris Radcliff

Re:Another quick comment

c_monster on 2001-08-14T16:42:44

Although this wasn't a 'learn to do CGI with Perl' book, per se, it would have been nice to see a section on safe CGI scripting.

That was an unfortunate ommission on my part. The book was originally titled Faster Perl Web Sites, and system calls of any kind tend to be speed killers.

I probably should have taken the fool-proof approach: "Never, ever do this. And if you do, use -T." ;) I'll add that to the online copy.

Re:errors, errors, lots of errors ... :-(

c_monster on 2001-08-14T17:20:48

Hi, the author again. Apologies for being all over this thread, but I feel some explanation is in order.

I couldn't find anything about the many efficient ways to solve the problems with the one to one relationship between Apache processes and mod_perl processes.

That's primarily because I couldn't either. That's why I mentioned FastCGI as an alternate method for doing so. I admit that I'm not a mod_perl expert, so I'd be happy to add your comments (or links to performance enhancements) to the online version of the book. See below.

Another huge mistake is that the book says that mod_perl and Apache are under the GPL license.

That's a big blunder on my part, started by a little typo. In my defense, note that changing one or two sentences to mention the ASL instead of the GPL will fix it (which I plan to do right now.) The rest of the section on "open source licenses" still applies, in my opinion. (The gist is "open source is good for software.")

Tim Bunce released v0.01 of DBI.pm and is still the primary developer.

I consider DBI one of those "on the backs of giants" modules. Also, I could have sworn that Tim mentioned another developer on the original project. (That was TPC2, though, so my memory could be failing me.) Either way, the principle holds. (Again, "open source is good for software." I'm not going to back down on that.)

mod_perl can do that too.

In truth, this is the objection I was most worried about when writing the book. Unfortunately, listing all the features of all the tools would have meant 99% overlap because they're all great choices. It would have made an excruciatingly long chapter. (Since the book was published, I've already come across half a dozen tools I didn't know about, and the ones I did have more features than I could describe in a whole book.) What I tried to do instead was give a sense of the choices, covering breadth at the expense of depth. The idea was that depth can be found on the Web, so readers are more likely to look for options.

Again, I really do welcome your comments. I'd like to keep evolving the online version of the book in a Perlish community fashion. Please let me know if you think something should be changed or added.

Cheers,
Chris Radcliff

Velocigen

solhell on 2001-08-17T11:57:44

I am very disappointed with the use of Velocigen in the book. I can understand a chapter of tutorial on Velocigen and how it relates to the rest of the book, but velocigen all over the place is very weird. I was going to buy this book right away, but after seeing the comments I changed my mind. Why spend time on a tool that I won't be using. I have a question who read the book:
If I don't want to learn or deal or read any Velocigen related stuff and code; do you think I can still benefit from the book?

Also what does this paragraph below exactly mean? *Reference implementation* meaning it is useless but you can spend hours on it just to find out that you can't use this for real world.

"Coinciding with the release of this book, VelociGen has kindly agreed to release a reference implementation of PSP for the Apache server as open source software under the Artistic License."

PSP != Velocigen

c_monster on 2001-08-20T03:00:10

If I don't want to learn or deal or read any Velocigen related stuff and code; do you think I can still benefit from the book?

Although most of the book's examples are written using Perl Server Pages (PSP), Perl is still Perl. I even have a whole chapter on different Perl embedding environments, including EmbPerl and HTML::Mason. It's a trivial task to adapt the examples to other environments, as I mention in that chapter (with examples).

*Reference implementation* meaning it is useless but you can spend hours on it just to find out that you can't use this for real world.

Actually, this reference implementation happens to be the exact same PSP module VelociGen uses, with references to the VelociGen environment replaced with references to the mod_perl environment. The module isn't ready yet, but I'd be happy to release the original version under the Artistic License if anyone's willing to help.

Cheers,
~chris

Apache::PSP posted

c_monster on 2001-08-20T23:24:58

There have been a couple of comments about the "reliance on VelociGen" in the book, so I figure it's important to note that version 0.1 of Apache::PSP is now available on the book's Web site.

Apache::PSP is a reference implementation of Perl Server Pages, the tag-based Perl embedding environment I use for examples in the book. It already allows arbitrary Perl to be embedded in HTML pages using mod_perl. When finished (soon), it will allow HTML-like tags to be defined using a combination of Perl and HTML. A library of tags for basic needs (like database access and template generation) will be included as well.

Please check out the module and let me know what you think.

Cheers,
~chris

Re:Apache::PSP posted

solhell on 2001-08-21T11:38:22

Thanks for the work.
So, what are (will be) the differences between this version and the commercial version. (What is the gain for somebody if they buy velocigen?, Does velocigen come with more predefined tags and libraries?).

Re:Apache::PSP posted

c_monster on 2001-08-22T15:58:20

So, what are (will be) the differences between this version and the commercial version.

There aren't any differences as far as PSP itself is concerned. All the same predefined tags are there. (They will be, at least, once I tie up all the loose ends.) There are tags for database access, XML processing, and Web client access, among others. There's also the <tag> tag which creates new PSP tags.

PSP pages written for either environment will work with the other. You'll need to install the corresponding CPAN modules (e.g. LWP, DBI, XML::Parser) to use all the tags, but they're all free for the download.

Of course, the real reasons to buy VelociGen are performance, scalability, and ease of use. It's intended for sites that need to process thousands of requests per second.

VelociGen can also run any CGI Perl script faster, no matter how badly written. A wrapper script cleans up all the common mistakes and persistence leaks.