Beta
×

Welcome to the Slashdot Beta site -- learn more here. Use the link in the footer or click here to return to the Classic version of Slashdot.

Thank you!

Before you choose to head back to the Classic look of the site, we'd appreciate it if you share your thoughts on the Beta; your feedback is what drives our ongoing development.

Beta is different and we value you taking the time to try it out. Please take a look at the changes we've made in Beta and  learn more about it. Thanks for reading, and for making the site better!

Web Development with Apache and Perl

michael posted more than 12 years ago | from the what-you-need-to-know dept.

Programming 221

davorg writes "In the dim and distant past when I first started doing web development, there was a book that everybody had a copy of. It was called 'How to Set Up and Maintain a Web Site' and it was by Lincoln Stein. The reason why everyone owned (and, more importantly, read) it was that it contained a complete high-level snapshot of everything you needed to know in order to run a web site at that time. Unfortunately, after a second edition in 1997 the book hasn't been updated. I suppose that the subject area has grown so much that no-one thought that a complete overview would be too high-level to be useful. They were probably right." davorg's review continues below.

I mention Stein's book because that's what this new book reminded me of most (that, by the way, is a huge compliment). Petersen realises that an overview of the whole web development area would be difficult to write (and, ultimately, unhelpful) so he restricts himself to a subset of the available technologies - Perl and Apache - and gives a thorough review of the state of the art of web development in these areas.

But before he gets into the details of Apache and Perl, in chapter 1 Petersen takes a look at the wider world of Open Source Software and in the process presents one of the best arguments I've seen in print for why a company should choose Open Source Software. In chapters 2 and 3 he takes the same approach with web servers and scripting languages, giving compelling reasons for choosing Apache and Perl.

Having chosen his architecture, in part 2, Petersen moves on to looking at some common tools for web development. Chapter 4 looks at databases. The two main Open Source Databases (MySQL and PostgreSQL) are compared and MySQL is chosen as the basis for the rest of the examples. Chapter 5 discusses the shortcomings of the standard CGI architecture and introduces mod_perl as an alternative. This is a good introduction to a technology that some people can find hard to get to grips with. Petersen takes us through the use of Apache::Registry before moving on to the complexity and power of mod_perl handlers.

Chapter 6 looks at the importance of security in web applications and discusses in some depth the problems of user authentication and the use of SSL for secure data transmission. Chapter 7 looks at ways to separate content from presentation. First we look briefly at server-side includes, but the majority of the chapter is taken up with a review of the various templating systems that are available for Perl. The chapter finishes with a detailed look at two of the most popular templating solutions - HTML::Mason and Template Toolkit.

Part 3 of the book looks at three different types of web site in great detail. In each case Petersen uses the examples to take a brief survey of a number of the existing tools. For example chapter 9 looks at a community web site and contains information about a number of web-based forums and chat rooms. It also takes an extended look at Slashcode the software that runs Slashdot. Chapter 9 takes a similar approach for intranet sites and Chapter 10 for online stores.

In part 4 we take a longer term view of a web site. Chapter 11 looks at content management systems and chapter 12 lookat at performance tuning. Both of these chapters are full of useful advice on how to make running a web server as painless as possible.

I think this is a very useful book to have on your bookshelf. Anyone who is developing web applications using Apache and Perl will find something useful in the book. It should be obvious that in order for a single book to cover so much ground, sometimes there isn't quite as much technical detail as you might like, but there is a good bibliography that will show you where to go for more information. In my opinion the high-level approach makes the book particularly useful for a couple of groups of potential readers. Firstly I think it makes a great introduction to the subject for someone coming to Apache and Perl for the first time. Secondly (and perhaps most importantly) I can see the book (in particular the first three chapters) being very useful reading material for a manager who is making a decision between using Open Source Software or some proprietary technology.


You can purchase Web Development with Apache and Perl from bn.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.

cancel ×

221 comments

Sorry! There are no comments related to the filter you selected.

FIRST POST (-1, Offtopic)

Anonymous Coward | more than 12 years ago | (#4032556)

First Post! Get your FIRST POST here!

Have you ever been sodimized? (-1)

Grape Smuggler (569838) | more than 12 years ago | (#4032570)

If not, then head on over to sporktestice.com and learn all the amazing facts about the mysterious would of gay sex, goats and sweaty sailors.

MySql over Postgres? perl over php? (0, Insightful)

MarsBar (6605) | more than 12 years ago | (#4032569)

My, this guy is making all the right decisions today...

my lyrics quiz... (-1)

Trolling Stones (587878) | more than 12 years ago | (#4032571)

can be found here [slashdot.org]

g to the oatse
c to the izzex
fo shizzle my nizzle this post is brought to you by the gap

If (-1, Offtopic)

yatest5 (455123) | more than 12 years ago | (#4032580)

choosing open source is such a good idea then do we really need shit like this pointed out?

in the process presents one of the best arguments I've seen in print for why a company should choose Open Source Software

Is there any chance we could go a full day on /. without a big circle jerk on how great OSS is?

Re:If (-1, Offtopic)

Anonymous Coward | more than 12 years ago | (#4032597)

no

Re:If (-1, Offtopic)

Anonymous Coward | more than 12 years ago | (#4032601)

without a big circle jerk on how great OSS is?


Why the hell wasn't I invited?!

Re:If (2)

wo1verin3 (473094) | more than 12 years ago | (#4032609)

>choosing open source is such a good idea then do
>we really need shit like this pointed out?

Do you see the market share Windows has? While it isn't right for everyone, there are a lot of people who ARE right for open source but don't know it yet.

Re:If (-1, Offtopic)

Anonymous Coward | more than 12 years ago | (#4032686)

Parent comment unfairly modded down. Please mod back up accordingly.

Just because you don't agree with it, it doesn't mean it's flamebait, offtopic or a troll. Hell, if it produces that much of a reaction it should probably be modded UP.

Sounds Like A Good Book, Creepy Cover Illustration (4, Funny)

Gryphon (28880) | more than 12 years ago | (#4032591)

Manning Publications Company always seems to have these creepy cover illustrations.

I much prefer the O'Reilly animals.

And yes. I am being a little facetious here.

Re:Sounds Like A Good Book, Creepy Cover Illustrat (3, Funny)

Mirk (184717) | more than 12 years ago | (#4032616)

Manning Publications Company always seems to have these creepy cover illustrations. I much prefer the O'Reilly animals.

What, even the slug book [miketaylor.org.uk] ? :-)

Re:Sounds Like A Good Book, Creepy Cover Illustrat (1)

Gryphon (28880) | more than 12 years ago | (#4032666)

What, even the slug book [miketaylor.org.uk]? :-)

Yes, I think even the slug book! ;-)

Re:Sounds Like A Good Book, Creepy Cover Illustrat (1)

archen (447353) | more than 12 years ago | (#4033158)

True in a Nutshell

2 pages, $1.95


Okay, do we REALLY need a 2 page book? And what good is true with out /bin/false? Why not make a grand slam manual and include /dev/null as well?

Speaking of Creeps-Breaking News +1, Informative (-1, Offtopic)

Anonymous Coward | more than 12 years ago | (#4032625)

Read about the:

Top 10 Conservative Idiots [democratic...ground.com]

Be patriotic; smoke Amerikan grown marijuana !

Put it back! (-1)

Fucky the troll (528068) | more than 12 years ago | (#4032594)

Put my balls back in your mouth, bitch. Now gently suck and hum at the same time. Thanks.

OSS and Dev in Perl and Apache (1, Interesting)

Delrin (98403) | more than 12 years ago | (#4032598)

I really find it hard to believe that Perl with apache could be the best example for why OSS works! These are hardly the best example of what they can do for a person or corporation. When the possibilities are endless, how does Perl fall into the fold?

Re:OSS and Dev in Perl and Apache (2)

Marc2k (221814) | more than 12 years ago | (#4032842)

You obviously didn't even finish reading his sentence..I really find it hard to believe that Perl with apache could be the best example for why OSS works!

From davorg's commentary, "in chapter 1 Petersen takes a look at the wider world of Open Source Software and in the process presents one of the best arguments I've seen in print for why a company should choose Open Source Software." That does *NOT* mean that Perl/Apache is the best argument for going Open Source, he's merely saying that the book provides good reasoning for doing so. The Mythical Man-Month was written 25 years ago and refers mainly to assembly and PL/I code (which is irrelevant since 95% of coding occurs in a higher level language today, and all's quiet on the PL/I front), but it still remains a definitive reference on software engineering principles and how to manage massive software projects. Good insight comes from the abstract, not the implemenatation.

Re:OSS and Dev in Perl and Apache (1)

Delrin (98403) | more than 12 years ago | (#4032883)

Thanks for the interesting clarification! I'll definately take a closer look.

Delrin

Movie Quote Quiz (-1, Offtopic)

Anonymous Coward | more than 12 years ago | (#4032617)

All of the following quotes are from the same movie, name that movie and it's genre:

"I'm comin' for ya' baby!"

"Why don't you get your own bag!"

"Let's hope it was worth it."

"How long will you be staying?"

Re:Movie Quote Quiz (-1, Offtopic)

Anonymous Coward | more than 12 years ago | (#4032736)

Title: Private Do It
Genre: Adult

Isn't it time web development moved on? (1, Insightful)

krog (25663) | more than 12 years ago | (#4032622)

Apache and Perl was the way to go in 1996, but times have changed. Systems like PHP and (here comes the -1 Flamebait mod) ASP are faster and more efficient than Perl CGI. Serious webmasters do it in Java or C anyhow, for serious speed.

Re:Isn't it time web development moved on? (1)

alan_d_post (120619) | more than 12 years ago | (#4032681)

You need to read up on EToys (RIP):

http://www.perl.com/pub/a/2001/10/17/etoys.html [perl.com]

Java is *not the answer*! Besides, I thought discussion on Slashdot was limited to software libre . . . .

You need to read up on website design (1)

krog (25663) | more than 12 years ago | (#4032717)

The link points to a story about how EToys set up a corporate website on mod_perl. Not about how mod_perl was the greatest thing since sliced shit and regularly tromped C++ and Java in benchmarks, but just that one could do it. Big deal! I'm not talking about how one *can* do it -- I'd advocate Common LISP in that case -- but about how one should do it.

Re:You need to read up on website design (-1, Offtopic)

Anonymous Coward | more than 12 years ago | (#4032758)

Dude, sliced shit isn't really that great.

Re:Isn't it time web development moved on? (2, Informative)

FortKnox (169099) | more than 12 years ago | (#4032864)

Perl CGI, when done correctly, can be a good solution for a large enterprise E-Commerce website. I don't like the look of the language, nor do I like how OOP is slapped in.

BUT

The chances of getting a large group of perl developers to code a large enterprise E-Comerce website and not take shortcuts nor kludges, and not to just fall away from good design and architecture is very rare.

Java, along with J2EE, JSPs, and taglibs FORCE you to follow good practice and design. Its a lot harder to 'kludge' something up without still following design and OOP (granted, its still possible). Another thing I LOVE telling C++/Perl/ASP people is taglibs. No other language has anything similar. An HTML monkey, that has NO coding experience, can modify JSP's that utilize taglibs. It just produces XML that HTML monkeys view as just more HTML tags.

All in all, having a perfectly designed J2EE website (built with experienced J2EE developers) vs a perfectly designed Perl/CGI website (built with experienced Perl developers) would show that the J2EE website would be easier to maintain and the ability of non-developers to change the design of the pages without any trouble.

The only negative point of J2EE is that its MADE for large projects. If you have a small e-commerce website, J2EE is overkill, and will take too much time to write. Perl/CGI is great for this type of site. But that is where I draw the line.

Re:Isn't it time web development moved on? (1)

ThatDamnMurphyGuy (109869) | more than 12 years ago | (#4032984)

Java, along with J2EE, JSPs, and taglibs FORCE you to follow good practice and design. Its a lot harder to 'kludge' something up without still following design and OOP (granted, its still possible). Another thing I LOVE telling C++/Perl/ASP people is taglibs. No other language has anything similar. An HTML monkey, that has NO coding experience, can modify JSP's that utilize taglibs. It just produces XML that HTML monkeys view as just more HTML tags.

I think you should go to AxKit.org [axkit.org] then and tell them they have nothing similiar :-) . It's a direct (I think) port of Cocoon from Java into Perl.

Re:Isn't it time web development moved on? (0)

Anonymous Coward | more than 12 years ago | (#4033016)

Another thing I LOVE telling C++/Perl/ASP people is taglibs. No other language has anything similar.

Actually ASP.NET uses a similar approach.

Re:Isn't it time web development moved on? (0)

Anonymous Coward | more than 12 years ago | (#4033031)

every time i come to slashdot i read something that is more stupid and ill-informed that my last visit. Well thanks buddy, your article is the biggest pile of festering cow shit I have ever read. Noone will ever post anything that comes close. I'm going to print this out and stick it on the wall.

Re:Isn't it time web development moved on? (0)

Anonymous Coward | more than 12 years ago | (#4033035)

Instead of spouting flames, perhaps you'd like to correct me?

Re:Isn't it time web development moved on? (1)

garcia (6573) | more than 12 years ago | (#4032737)

yeah, but for some websites speed and beauty really don't matter.

For a quick and dirty form or simple "database" of information perl is easiest for me. Why should I have to sit down and read through PHP stuff when I already know perl?

Re:Isn't it time web development moved on? (0)

Anonymous Coward | more than 12 years ago | (#4033201)

Yeah I said the same thing about C++ -- Why should I have to sit down and learn C++ when I already know Pascal?

PFFT!

Re:Isn't it time web development moved on? (1)

Anders Nielsen (12929) | more than 12 years ago | (#4032748)

From the review it looks like the book contains a lot of info about mod_perl so I don't see your point!

Re:Isn't it time web development moved on? (5, Insightful)

Daniel Dvorkin (106857) | more than 12 years ago | (#4032775)

Old-school Perl CGI is relatively slow, yes, though an awful lot of that has to do with the quality of the back-end code. But mod_perl is unbelievably fast -- and I say that as someone who makes his living developing and maintaining a database with a Web interface written in PHP, so it's not like I'm prejudiced in Perl's favor. "Serious webmasters" choose whichever tool gets the job done best, and if they're also good programmers, they write good, clean code that executes fast enough that the client doesn't have to care what's driving the site.

That being said (anti-flamebait!) I'm amazed you mentioned ASP, not because of of its flamebait value, but because, um, it sucks. I swear to God, there must be "if(client != "IEWin"){slow_down(); crash_unpredictably();}" in the source somewhere. Even these days, old-school Perl CGI is often the right tool for the job. Unless you're developing 100% for IEWin, IIS, and MS-SQL, ASP never is.

Re:Isn't it time web development moved on? (1)

krog (25663) | more than 12 years ago | (#4032846)

Unless you're developing 100% for IEWin, IIS, and MS-SQL, ASP never is.

that has nothing to do with ASP at all. that's 100% in the web programmer's hands. MS-SQL is certainly no worse than MySQL, which the book advocates.

i'd rather use Apache than IIS anyday though.

Re:Isn't it time web development moved on? (1)

c13v3rm0nk3y (189767) | more than 12 years ago | (#4032943)

i'd rather use Apache than IIS anyday though

Wasn't there comparision of Apache and IIS done last year that basically found that you should use the platform that your server software is best suited for? that is, they found that if you need to run a bizniz web server on Win32, then you should use IIS, MSSQL, ASP and friends.

They found that, from a maintenance, performance and development standpoint, running Apache on Win32 (for example) was pounding a square peg into a round hole. Note that nobody was saying "you can't run Apache on Win32", just that it was not recommended for various reasons. The number one reason was performance.

Obviously, Microsoft has plenty of access to obscure or even "secret" Win32 APIs.

Just one study, AFAIK, and I don't know how dependable the source is, but it seemed to confirm some anecdotal evidence I had accumulated.

Re:Isn't it time web development moved on? (2, Informative)

FortKnox (169099) | more than 12 years ago | (#4033014)

Even these days, old-school Perl CGI is often the right tool for the job. Unless you're developing 100% for IEWin, IIS, and MS-SQL, ASP never is.

Go to monster and search on perl/cgi based jobs for web work.
Now search on Java based jobs for web work.

In general,
Your general simple/small/little processing pages use perl.
Your smaller companies that require dynamic pages use ASP.
Large business that have huge enterprise sites with multiple intraweb applications run Java/J2EE.

I've had multiple jobs that required me to change a smaller webapp from perl into Java since it started small and grew into a large program and started becoming difficult to maintain.
If I had time, I'd love to take slashcode and make it into a fully J2EE website to prove, once and for all, how much of an advantage it is for large websites to change to J2EE.

Now, don't get me wrong, perl is a WONDERFUL scripting language that I use almost daily. It makes great little sites (or even large sites that don't require a huge amount of processing/code) that you need to create in a short amount of time. Just, when it comes to making a large project with funding and time, J2EE has enough advantages and features that makes the job so much nicer. Maybe I'll make a journal entry to fully argue the points back and forth.

Re:Isn't it time web development moved on? (0)

Anonymous Coward | more than 12 years ago | (#4033169)

Now, don't get me wrong, perl is a WONDERFUL scripting language that I use almost daily. It makes great little sites (or even large sites that don't require a huge amount of processing/code)

How is Slashdot a large site that "doesn't require a huge amount of processing/code"? How is Kuro5hin? Show me a community site that is larger than Slashdot or even K5 and written in Java. There's a reason these sites run on mod_perl: It's fast, it's scalable, it's easy to code, it gets the job done. Slashdot and K5 are L/BAMP success stories. Face it, most J2EE sites will never have Slashdot's load.

If you take a look at Scoop, the K5 Perl code, you'll see that it is very much possible to write high quality, maintainable Perl. On the other hand, I've seen many projects fail simply because they used Java, which proved to be too slow for the job. In my opinion, Java is an overhyped technology that is adopted by those who don't know better and has contributed to many project failures of both hobbyists and companies. It's a resource hog, and while OOP is a helpful mechanism to structure code (you can create OOP programs in Perl as well), its importance for creating maintainable projects is overrated -- most Linux applications are written in plain old C, for a good reason.

I'd much rather use Python or Perl than Java. Java is for those who don't know better. (also see Doug's comparison) [bagley.org]

Re:Isn't it time web development moved on? (0)

Anonymous Coward | more than 12 years ago | (#4033051)

You should try ASP.NET then. Not only is it precompiled and therefore much faster, it also is cross-browser, cross-platform friendly. And since it uses a CLR you can code in whatever language you are used to without any performance hit. I am especially looking forward to the MONO project taking on ASP.NET so that we can get away from Windows on the server.

Not necessarily true (1)

OmniVector (569062) | more than 12 years ago | (#4032776)

Look at the benchmarks for PHP vs ASP lately, it usually outperforms it. i'm sure C is faster, but i haven't read a thing on java servlet pages and how it performs speedwise. I actually thought java servlets would be slower than php but i could be wrong.

Re:Not necessarily true (2, Interesting)

lindner (257395) | more than 12 years ago | (#4033101)

Check out the "hello world" benchmarks at www.chamas.com [chamas.com] . mod_perl is right at the top of the heap when it comes to performance (after a C-based apache module) then java, THEN php.

From the site:


Welcome to the Hello World! benchmarks. This site seeks to give its visitors a sense of web application execution speed on various software platforms running under the Apache web server. ...... The benchmarks instead tend to be written for a lowest common denominator so more web applications can compete than not.

Re:Isn't it time web development moved on? (1)

spencerogden (49254) | more than 12 years ago | (#4032803)

I am probably biased because I learned perl first. However at work I use both of them(perl and PHP). And consequently I hate PHP with a passion. I dislike the monolithic approach. I like CPAN where I can bite off one module at a time, get its documentation all in one place, and get my head around it. In PHP I find my self wading through oracle database calls to find docs on basic functions. Speaking of database calls, why is there zero abstraction in PHP? why do I have to find and replace every function call to change databases.

Also I think the embedded nature of PHP, while handy in simple cases, encourages people to mix up program logic and presentation.

And of course my favorite, you can't beat using the CPAN shell to install new modules.

I don't know about performance, I haven't seen benchmarks on mod_perl vs. PHP, but if you think most web apps are hindered by program runtime, you are looking in the wrong place for optimizations.

Re:Isn't it time web development moved on? (1)

briandonovan (465839) | more than 12 years ago | (#4032899)

Speaking of database calls, why is there zero abstraction in PHP? why do I have to find and replace every function call to change databases.

Have you heard of Pear DB [evolt.org] ?

What is PEAR? [php.net]

Good Luck.

Better than CPAN.pm, CPANPLUS (2)

twoshortplanks (124523) | more than 12 years ago | (#4032963)

And of course my favorite, you can't beat using the CPAN shell to install new modules.
Actually, I prefer CPANPLUS, read the article [perl.com] about it.

Re:Isn't it time web development moved on? (2)

mgkimsal2 (200677) | more than 12 years ago | (#4033175)

why is there zero abstraction in PHP?

Because it's using native drivers wherever it can and you get the best performance that way. If you WANT abstraction (and the accompanying slowdown) you can use ADODB, Metabase, PEARDB, or other projects.

Re:Isn't it time web development moved on? (2)

loconet (415875) | more than 12 years ago | (#4033235)

<i>"...get its documentation all in one place, and get my head around it."</i>

Ever visited php.net ? the official PHP manual is one of the best manuals I've ever read.
Everything is there! Well organized and easy to find. You also have user comments which are extremely helpful.

<i>"Speaking of database calls, why is there zero abstraction in PHP?"</i>

How hard is it to code your own wrapper functions to add your own level of abstraction on top of php's DB functions? Or use one of the million classes out there already created for you?

<i>"Also I think the embedded nature of PHP, while handy in simple cases, encourages people to mix up program logic and presentation. "</i>

So you are telling me that you prefer:

#!/usr/bin/perl
$var="Hello World";
print "Content-type:text/html\n\n";
print "<html>\n";
print "<body>\n";
print "$var\n";
print "</body>\n";
print "</html>\n";

Over this?

<?php $var="Hello World"; ?>
<html>
<body>
<?php print "$var\n"; ?>
</body>
</html>

Embedded languages like php/jsp/asp PROMOTE separation of presentation and program logic!

In addition for more complex cases, it is easy create html templates to add yet another level of abstraction to your scripts/presentation.

Ask your html designers to try importing the .pl file into their favorite html editor (dream weaver? front page?) You can say bye bye to your perl code. In the other hand, with script tags like <? ?> The editors will know not to touch those!

How about text editors that do syntax high-lighting? with <? ?> they can do syntax highlighting for both, HTML AND PHP! giving the programmer a visual of the actual separation!

So.. the embedded approach encourages people to mix up program logic with presentation? Don't think so.

Re: Isn't it time web development moved on? (2, Informative)

XTaran (70498) | more than 12 years ago | (#4032877)

You never heard of mod_perl [apache.org] , FastCGI [fastcgi.com] , Embperl [apache.org] , or the Template Toolkit [template-toolkit.org] if you're still talking about PERL CGI scripts, have you?

Apache and PERL is still the bleeding edge of web developement. It's just no more alone at the top. Perhaps you should take a look on these Benchmarks [chamas.com] . Especially the JSP don't look very good there and Embperl2 is usually very close to PHP regarding performance. Only Apache modules written in C are without real competitor. But you should also think about the ease of developent if you compare C code with PERL, PHP, ASP or JSP.

Re:Isn't it time web development moved on? (2)

Etyenne (4915) | more than 12 years ago | (#4032906)

Apache and Perl was the way to go in 1996, but times have changed. Systems like PHP and (here comes the -1 Flamebait mod) ASP are faster and more efficient than Perl CGI. Serious webmasters do it in Java or C anyhow, for serious speed.

Serious Web programmer do not even mention "CGI" and "speed" in the same sentence.

Now,for some serious flamebait : PHP has always stuck me as an adequate, if somewhat anemic, Perl replacement but nothing more. It have a few very good library (PEAR and Horde), but nothing nearly as complete as CPAN. Zend is reputed very fast, but is it faster than mod_perl ? Instead of throwing half-baked opinion, please provide some hard number to back up your claim.

And what's ASP ? Is this some kind of tasty threat ? Never heard of that before ...

Re:Isn't it time web development moved on? (0)

Anonymous Coward | more than 12 years ago | (#4032995)

I guess mod_perl (no forking involved) is more comparable to PHP than to CGI-BIN.

Re:Isn't it time web development moved on? (1)

ThatDamnMurphyGuy (109869) | more than 12 years ago | (#4033072)

Serious webmasters do it in Java or C anyhow, for serious speed.

If speed is your only concern for using a particular language in web development, I think you're missing ths big picture.

IMHO, the difference in speed between C/Java/Perl/PHP/ASP for web development doesn't mean squat. If you are querying a database 1,000,000 times a day for content that changes twice, you have a problem.

Pick any language you want. Who cares. When you start talking about high hit counts and high loads, more of the problem will come down to caching, push vs. pull of content, and server/cluster/network layout.

Re:Isn't it time web development moved on? (1)

Digital_Fiend (41244) | more than 12 years ago | (#4033097)

I can't believe this was modded up to +3.

"Apache and Perl was the way to go in 1996, but times have changed." What?! This is the same type of fallacious argument that Microsoft uses against UNIX; "it's 30 years old, it can't be any good!"

Of course, generally, the entire reason one uses a high-level language (like Perl, or Python, or PHP, or whatever...) is because quickly putting something together is more important than lightning-fast speed. It's safe to say that web development is one of those tasks which generally benefits more from the former than the latter. With this in mind, your (unsupported claims) of Perl CGI's "efficiency" problems are irrelevant. Could we see something like benchmarks, or any kind of evidence?

Your comment about "serious" webmasters "doing it" in "Java or C" for "serious speed" strikes me as being particularly odd. Your use of the word "serious" seems quite silly; there are plenty of serious [kuro5hin.org] 'webmasters' [slashcode.com] using [apache.org] Perl [w3.org] . As for the languages you mention, almost no one uses C; that defeats the entire purpose of general web development methodology. Again, your claims are completely unsupported by any further evidence.

Personally, if I need to do any web scripting, I have my own language of choice [python.org] .

Web Development and the Federal Government (2, Interesting)

Blind Linux (593315) | more than 12 years ago | (#4032624)

Unfortunately, after a second edition in 1997 the book hasn't been updated.
And yet, it's still being used in the Department of Foreign Affairs as need-to-know material for our intranet site developers.
However, most of the n00bs here seem to read PHP and MySQL web development [amazon.com] , by Luke Welling and Laura Thomson.
The Canadian government uses Java, XML, VB/VBA, SQL Server, and ASP, but SQL and PHP are the primary ones.
I did ask around at web development and we did in fact order copies of the new book that you reviewed though. Cool, eh?

Are books the way forward? (5, Insightful)

Aliks (530618) | more than 12 years ago | (#4032632)

Don't want to be a troll but no matter how good the book is, surely for material like this, the web itself is the best medium.

A paper book is certainly more portable, and for most people easier on the eye, especially when you read for a long time but . . .

Topical material is quickly out of date

You can't search too easily for the topic or phrase you want

You can't easily look up a reference for a term or concept you don't understand

If a certain paragraph doesn't make sense you can't look for alternative statements of the same concept

Once you've read it there isn't any easy way to look up a particular section when you next need it (the books at home, borrowed by a colleague etc)

Books cost!

Re:Are books the way forward? (1)

gnalre (323830) | more than 12 years ago | (#4032741)

For people like you they also provide the book in ebook format(PDF)(See http://www.manning.com [manning.com] ). Good price too and a discount if you wish to go to a more tree based existance. I wish more publishers woukd do that!

Re:Are books the way forward? (0)

Anonymous Coward | more than 12 years ago | (#4032791)

A paper book is certainly more portable

books are more portable away from computers, but from any computer i sit down at i can get to my favorite websites and i don't have to carry anything with me. the web is more portable when i need it.

for most people easier on the eye, especially when you read for a long time

for those who need reading glasses, the bright light of a screen contracts the pupils and makes focusing and reading easier than the printed page.

Re:Are books the way forward? (0)

Anonymous Coward | more than 12 years ago | (#4032823)

I still buy the "staple" books from Oreilly and others, but so many books are just that: outdated and re-hashed versions of publicly availible information.

Case in point:

I bought a "basic" Java book, but use java.sun.com for reference on all the API's that I use.

It does not make sence in ecological or financial terms to buy a whole refrence set of books when the data is online.

The key point here is "reference". Reference books are trying to track a moving target. Books that are language definitions and intro books have more staying power (more bookshelf longevity and therefore are more financially reasonable, and will not be tomorrow's landfill).

---

The company I work for just threw away TONS of software manuals that they had been saving.

I am beginning to loathe this industry for the waste that it produces.

Re:Are books the way forward? (5, Insightful)

bluGill (862) | more than 12 years ago | (#4032917)

Depends on what you want to do. Online is better when you are at a computer (with net access) and know what you want to know about. Paper is better when you just want to learn something interesting. I have not yet found a good way to skim online documentation and when something catches my eye drill down deep. Scrolling doesn't seem to work that way for some reason. An index is worse, it doesn't tell you if something is useful, so you have to look, which means wait for page loading times. After a few misses you give up.

Both types have their place. I wouldn't want to be without my printer, even though I haven't turned it on in several weeks. There will never be a paperless office because when the problem gets really tough I print out everything, and then (as Fred Brooks said) take to the floor to figgure things out. Don't try to get rid of paper, use both paper and the computer to compliment each other.

Re:Are books the way forward? (1)

PainKilleR-CE (597083) | more than 12 years ago | (#4033120)

Topical material is quickly out of date

I think that's why things that are generally at a higher-level (as the review says this book is) tend to be much better, and have a longer shelf-life, than the typical programming book. At the same time, I find it to be helpful to get particular books to build my own basis for a particular language or application, and then find more detailed and up-to-date information from there. Of course, I have about 6 boxes of computer books (mostly programming, some administration) sitting in my room waiting to be unpacked after moving across the country about a month ago.

As another poster pointed out, though, the ebooks that are packed on the CD with more and more of the new books are great, especially when you don't want to lug a 900 page book around (or worse, 3 or 4 of them, as I have a tendency to read on multiple things at a time to keep from getting bored with a particular subject).

Amazon has lots of sample pages (5, Informative)

sootman (158191) | more than 12 years ago | (#4032640)

TOC + 48 pages of text here [amazon.com] .

Re:Amazon has lots of sample pages (0)

Anonymous Coward | more than 12 years ago | (#4032798)

How is this Offtopic

Tomorrow's Lunch (-1)

LunchLady (555057) | more than 12 years ago | (#4032646)

I am back from the dead...

For lunch tomorrow I plan on going to Red Robin in Dulles, VA. I find their Five Alarm Burger to be one of the best around. It's a rather large portion of ground beef in burger form topped with cheese, lettuce, and jalapenoes. The whole meal is topped off with bottomless fries - you can't got wrong!!!

Thank You.

No Discussion of XSLT? (5, Interesting)

Mirk (184717) | more than 12 years ago | (#4032664)

Chapter 7 looks at ways to separate content from presentation [...] the majority of the chapter is taken up with a review of the various templating systems that are available for Perl. The chapter finishes with a detailed look at two of the most popular templating solutions - HTML::Mason and Template Toolkit.

It's a real missed opportunity if this book doesn't also talk about using XSLT as a way to separate content from presentation - especially as the Apache project has its own XSLT engine, Xalan, available in both C++ and Java.

A quick HOWTO on wiring that gear into an Apache configuration would be really useful.

Re:No Discussion of XSLT? (1)

davorg (249071) | more than 12 years ago | (#4032689)

Actually there is a section in that chapter about XML technologies. It mentions AxKit [axkit.org] in particular.

Re:No Discussion of XSLT? (3, Informative)

Stinky Cheese Man (548499) | more than 12 years ago | (#4032815)

It's a real missed opportunity if this book doesn't also talk about using XSLT as a way to separate content from presentation
I'm not familiar with XSLT, but one of my big gripes about Perl web development (and developers) is that so many Perl CGI scripts do something like...

print "<html>\n";
print "<head>\n";
print "<title>\n";

... ad nauseum.

No wonder so many people think Perl is obsolete as a web development tool. This is a hideous way to do things. Anything but the most trivial HTML produced in this way will be very difficult for a programmer to maintain - let alone a web designer.

Here is a short tutorial I recently wrote on separating content from presentation using HTML templates with Perl.

http://www.calypteanna.com/templates.html [calypteanna.com]

Re:No Discussion of XSLT? (1)

davorg (249071) | more than 12 years ago | (#4032861)

Here is a short tutorial I recently wrote on separating content from presentation using HTML templates with Perl.

Interesting article. But Im'm interested why you invented your own templating system instead of using one of the ones aready available for Perl, like HTML::Template, HTML::Mason or the Template Toolkit.

Re:No Discussion of XSLT? (0)

Anonymous Coward | more than 12 years ago | (#4033074)

Because he's an idiot.

The <<$secret_number>> Pattern is born (2)

nwetters (93281) | more than 12 years ago | (#4033058)

Stinky Cheese Man: Here is a short tutorial I recently wrote on separating content from presentation using HTML templates with Perl. http://www.calypteanna.com/templates.html

ARF! I hope you are joking. That you got modded up for implementing Model-View-Controller using $MAGIC_NUMBER is the funniest thing I've seen all week.

An OK book but... (-1, Offtopic)

Anonymous Coward | more than 12 years ago | (#4032688)

No story line. No hero. Even the murder was a bit suspicious. I prefer Agatha Christie any day.

Stick and Stein (-1, Offtopic)

Anonymous Coward | more than 12 years ago | (#4032698)

Seeing the name Stein reminded me of the phrase "Stick and Stein", and I can't remember what that was. Oops. Oh yeah, forgot I was on the internet for a minute there. Ahh, Stick and Stein is a catchy word for a bar with a pool table. When I was a kid, my brother and sister used to tease me by saying "Stick and Stein! Stick and Stein!" And I never knew what the hell they meant by that. 20 years later, I finally understand. Think I'm gonna call that Burke guy who does the Connections program.

The problem with this book (-1, Flamebait)

SkipToMyLou (595608) | more than 12 years ago | (#4032700)

The problem with this book is that the topics they cover suck. Popular sites such as this one run this combination, and it results in downtime and complaining. Also, due to their open source roots, these programs are usually run on Linux, which reduces stability further. I applaud the author of this book for taking the time to try to teach readers how to use the latest "cool" web platform, even if it may be dangerously unstable.

Re:The problem with this book (-1)

Anonymous Coward | more than 12 years ago | (#4032759)

The problem with this book is that the topics they cover suck. Popular sites such as this one run this combination, and it results in downtime and complaining. Also, due to their open source roots, these programs are usually run on Linux, which reduces stability further. I applaud the author of this book for taking the time to try to teach readers how to use the latest "cool" web platform, even if it may be dangerously unstable.

Re:The problem with this book (1)

np_geek (313391) | more than 12 years ago | (#4033028)

You apparently didn't read the article - it's not about .Net, althought I'm not sure I would describe .Net as "cool".

COMMON SENSE WARNINGS WHEN DEALING WITH A UFO (-1, Offtopic)

Anonymous Coward | more than 12 years ago | (#4032714)


1. Do not touch or attempt to touch a UFO that has landed. Passing through the Earth's atmosphere the skin of the craft will be hot.

There is also a possibility of radiation. There is also a chance of steam being produced from the heated hull at the landing site.

2. Do not stand under a hovering UFO at low altitude. There is a possibility of radiation danger.

3. DO NOT ATTEMPT TO CONTACT ALIENS if they appear, any movement on your part may constitute an act of aggression. If possible, back away VERY slowly. Make no gestures what so ever.

4. If possible note the time and take a photograph if possible. Note the shape and size of the craft, use nearby objects for a size comparison.

5. Do not touch any artifact from an alien spacecraft, the artifact may be dangerous, leave this to the authorites.

6. Get away from the area QUICKLY. Inform the local authorites or the military.

Good documents on security (1, Informative)

Anonymous Coward | more than 12 years ago | (#4032774)

www.cgisecurity.com/lib [cgisecurity.com]

One point... (-1, Troll)

Kith_Me (257285) | more than 12 years ago | (#4032778)

I always say this when Perl topics come up.

Perl is Dead. D-E-A-D. Dead.

Lets move on to something not so convoluted, like python.

Re:One point... (0, Troll)

davorg (249071) | more than 12 years ago | (#4032824)

I always say this when Perl topics come up.

And doesn't the fact that Perl topics keep coming up rather disprove your theory?

Perl is Dead. D-E-A-D. Dead.

Have you told that to the folks who are still happily using, extending and improving it?

not to be too flamey (2)

r00tarded (553054) | more than 12 years ago | (#4032785)

i know this is slashdot and all but i would like to hear some sensable (non religous) reasons that post-1998 php would not be the default open source web application development platform.
Im currently engaged in trying to update someone else's perl web application and the five hairs i have left are screaming for me to just ditch it all and reimplement in php. It just *seems* more web oriented, perl tries to be many things to many people, while php is all web all the time. I think this shows in the fundemental design of the languages.

Re:not to be too flamey (0)

Anonymous Coward | more than 12 years ago | (#4032903)

PHP is great for smaller websites that don't require much maintainence (or do little processing).
Java is great for large enterprise websites that allow time to create/implement.
Perl is great as a scripting language, and is a must on all *NIX boxes.
C++ is great for applications.
C is great for memory/CPU intense programs.
Assembly is used when every clock cycle matters.

That SHOULD BE the view for most developers. Its the popular languages that companies hire developers for (and don't give me that "but MY company hires LISP people", cause your in one of like five companies that do).

Re:not to be too flamey (2)

mgkimsal2 (200677) | more than 12 years ago | (#4033145)

Gosh, if someone was 'allowed' time to create/implement, I don't think many would *choose* Java. Obviously some would, but I'm not sure the majority would, even for larger projects.
The (admittedly few) Java projects we've done *required* more time to create/implement, and not because of the size of the project, but because of the language itself, when compared to developing equivalent functionality in Perl or PHP.

Re:not to be too flamey (2)

zsmooth (12005) | more than 12 years ago | (#4033127)

i would like to hear some sensable (non religous) reasons that post-1998 php would not be the default open source web application development platform

Because mod_perl using some sort of templating is sooooo much nicer than PHP. PHP makes it a pain to separate code from presentation. Yes, people do do it, and there are templating php modules available, but none as nice as the perl offerings (Template Toolkit, HTML::Template, etc). Perl is also just a funner language to write in than php. You can do about everything in php you can do in perl, but it just doesn't feel right (doing re's in php makes me want to vomit, calling those stupid preg_match() functions and stuff). I maintain two semi-complex web-sites that I had originally written in php, but moved to mod_perl because it's so much nicer to write in. And according to my benchmarking, the mod_perl sites are as fast or faster.

Re:not to be too flamey (3, Informative)

twoshortplanks (124523) | more than 12 years ago | (#4033139)

I'm going to come out and say straight away that php has some really good points, and I'm all for using the best tools for the job. Just shoulting "My Lanauge is Better than Your Lanauge" gets us nowhere.

When doing a full evaluation I'd like to have a look at all the options. People looking at Perl tend to overlook some of the support systems in it which allow you to produce a more structured application and tend to try and reinvent their own systems. This is bad, and is where people who haven't stopped to think about what they're doing get their misconceptions.

For example I suggest you have a look at the Tempalte Toolkit [tt2.org] language that allows you to use a simple templating system to write directly in HTML and then call to pure Perl plugins when you need the power - and the ability to use existing modules off of CPAN. Slashdot uses the Template Toolkit to do some of it's templates.

Another system that someone sensible would look at is the AxKit [axkit.org] system. AxKit is Apache Foundation project similar to Java's Cacoon system that allows you to use XSP and XSLT and other buzzword friendly XML systems to do dynamic transformation of XML with perl taglibs as you need it. What's PHP's way of dealing with XML? Can you write XSLT stuff in it? Can you use XPath, SAX and all that to process document pipelines? What's the framework like to work with? Honestly, I'd like to know - I haven't looked into it at all.

On a simplier note, you might want to look at some of the very simple web application frame works, for example CGI::Application (which despite it's name will run very fast under mod_perl.)

Finally, I'm not sure how easy it is to test PHP. Perl has quite a powerful set of testing tools that you can use to easily determine if each bit of your code is working correctly...I'd be really interested if someone could post a discussion of what PHP has to offer in this area.

I can understand how someone else's web application could seem terrible....but I've seen terrible php too! But it's unfair to blame the language for a particlar code example - I congratulate you on your sensible decision to examine the options properly.

Re:not to be too flamey (1)

lindner (257395) | more than 12 years ago | (#4033238)

I like PHP as much as the next guy, it works for the simple stuff quite well, and it's easy to install...

Anyway, here's my list of why you should consider mod_perl more "web-oriented" than PHP.

  1. Hooks directly into the Apache API. You can run code at many different levels, URL munging, authentication, logging, etc.
  2. You can use mod_perl to configure apache. For example you could configure a thousand virtual hosts from the information in a database. All using a few lines of perl code.
  3. Great Architecture support. Want to implement sessions, what about authentication to any number of protocols? Templates? check.. Complete application frameworks? Yep that too. Often the problem is choosing between the different platforms built on top of mod_perl..
  4. Fast, fast, fast! need I say more..

Swing on over to the mod_perl Cookbook [modperlcookbook.org] site or the main mod_perl site [apache.org] for many reasons why you should consider this great technology.

(note I co-authored the cookbook above. But I've used mod_perl professionally for quite some time and have compared it to other, more lacking environments and whole-heartedly recommend it.)

Re:not to be too flamey (0)

Anonymous Coward | more than 12 years ago | (#4033240)

You answered your own question. You use perl because it is so flexible. Why learn a new language for each task when perl does so many things very well. If you learn php you can write web pages, where as if you learn perl you have a general purpose tool. I don't carry separate srewdriver, pliers and pocket knife with me. I carry a Leatherman.

Apache ?! And Perl?! (0, Flamebait)

WetCat (558132) | more than 12 years ago | (#4032799)

I just dropped apache in favor of AOLserver.
If you want to handle REAL loads - nothing is better
than AOLserver...

The arguments (3, Insightful)

InsaneCreator (209742) | more than 12 years ago | (#4032819)

Petersen takes a look at the wider world of Open Source Software and in the process presents one of the best arguments I've seen in print for why a company should choose Open Source Software

Could you _please_ share some of them with us? Because I'm really sick & tired of the same old "Anyone can change the source and fix the bugs" argument. Sooner or later people will have to realise, that the companies we want to convince switching to linux is a good idea, couldn't care less about the ability to change the source. Some of them even get turned off by this argument, since they believe it contans an implicit "You will have to change the buggy code yourself", just like when you're buying a house and the ad says it's perfect for a creative, DIY-type person - and you know you'll have to replace the roof, the walls and the floors within 2 weeks. :)

Re:The arguments (1)

imta11 (129979) | more than 12 years ago | (#4032856)

Well, right not i have a code generator that produces one bug, about 200 times, so now instead of devoting my time to fixing that bug or moving on with software, I have to waste time creating a workaround because the next release isint due for 2 months. If it was open source I could fix the bug once, and share it. That is the big win. The implicit "change the buggy code yourself" you are bitching about indicated to me that your mother must have done everything for you. What do you do when she is busy with her other children?

Meow! (0)

Anonymous Coward | more than 12 years ago | (#4033152)

My, aren't we a bitchy little pantywaist today?

Re:Meow! (1)

imta11 (129979) | more than 12 years ago | (#4033250)

hahahahahaha

Re:The arguments (1)

davorg (249071) | more than 12 years ago | (#4032915)

Well, the other big ones are cost (obviously) and transparency. All the data structures and file formats for Open Source Software are necessarily available for anyone to see. This means it's very easy for other applications to interact with your data. Of course, using published standards is also a big help here.

Also because of the large developer base for most Open Source Projects the software produced tends to be of a higher quality. I'm not saying this is true of all Open Source software, but there seems to be a very high correlation.

Re:The arguments (2)

bluGill (862) | more than 12 years ago | (#4032970)

But that cuts both ways. The house you sited is attractive to the can't stop handy person who wants to buy a house, fix it, and sell it at a big profit a few years latter. Doubling your moneyin two years is not unusual on a house like this. (note, if you hire the work done you fall behind, but if you do it yourself, and live there you come out ahead when you consider the rent you would pay otherwise, and you have to love working on houses).

The advantage of openSource is you can, but don't have to modify it. Instead of dropping the statement entirely, we should drop the "and fix the bugs" part. When you use a closed source program you are at the mercy of your vender to get new features. If you want X, and they say it won't sell enough to be worth it, then you are stuck. With open source you can do it yourself if you have to.

Re:The arguments (1)

InsaneCreator (209742) | more than 12 years ago | (#4033077)

I have to agree with you. :) While it is not very easy to find someone who can fix the house, or in this case a linux bug, by themselves, they still are an important part of linux developement.

Re:The arguments (0)

Anonymous Coward | more than 12 years ago | (#4033065)

What if you want to add a feature that isn't popular enough for your vender to add to their closed source application. Do you replace the entire solution? What if you wanted bug fixes in an old outdated and no longer supported piece of software like Windows NT 4.0 or 98? Do you upgrade all your systems to their latest version and risk incompatibility with your old apps. At what cost are you willing to pay to maintain your closed source solution? It is for these reasons that I no longer promote open source solutions. I let management make their own decisions and deal with the consequences of their actions. Not willing to piece together your own solutions with solid built tools and materials? Fine, then outsource it and deal with their tech support. At least I don't have to worry about getting fired for making bad decisions that cost my company a lot of cash. :)

Perl is evil (0)

Anonymous Coward | more than 12 years ago | (#4032862)

Perl is evil, both in the scarlet letter and in the land of computers. There are so many more technologies that are far better suited for web development. Perl however, is not one of them. Though I'm primarily an OOP boy, I think that PHP has certainly transformed the face of web development under *nix. So let's stop posting nonsense about books that were outdated *before* they were printed and review something a bit more relevent to the current day and time.

*Yea!*

Web resource for perl / cgi newbies (2)

killbill (10058) | more than 12 years ago | (#4032994)

I threw together a light little intro (I believe this one uses Perl / Apache on a windows platform) for some classes I taught.

http://www.kilgallonfamily.com/perlhappypath/ind ex .html

It is about 8 months out of date, but is VERY simple and straightforward. Perfect for a newbie. It walks you through just about all the basics, and is designed to keep a new and inexperienced student motivated and excited about what they are doing.

I taught it several times, and it works well in a classroom. It is released under the GPL.

Bill

Re:Web resource for perl / cgi newbies (2)

killbill (10058) | more than 12 years ago | (#4033015)

Darnit... a space somehow sneaked in that URL... Try just:

http://www.kilgallonfamily.com/perlhappypath/

Re:Web resource for perl / cgi newbies (0)

Anonymous Coward | more than 12 years ago | (#4033091)

Jesus H. Christ. What is your major malfunction numb nuts?. And the award for most pointless piece of self-defamation goes to Cowboy Bill.

ohh no (1)

Space_Nerd (255762) | more than 12 years ago | (#4033025)

another PHP vs Perl flamewar?

Re:ohh no (-1, Troll)

Anonymous Coward | more than 12 years ago | (#4033070)

Hey don't forget HTML. That programming language rules man. Whips the ass of Perl and PHP any day of the week.

Yours
Larry Wall. (the guy who discovered php)

ps. hey nonny nonny

Don't do that (0)

Anonymous Coward | more than 12 years ago | (#4033148)

When I read the headline I thought you were talking about an updated version convering Apache 2.0

Why Perl (5, Insightful)

LinuxParanoid (64467) | more than 12 years ago | (#4033177)

When I started web programming 2 years ago and faced the choice between working with Java, Perl and up-n-coming PHP, I looked around and it seemed to me that the people using Perl were doing the most innovative, creative stuff on the web. (Slashdot's "distributed moderation" scheme, which I regard as a quantum improvement over USENET moderation for providing large-traffic yet readable forums was just one example.)

I wanted to do innovative, creative stuff, so I started writing Perl.

No regrets. I don't think that aspect of Perl has been particularly usurped. Nor do I think there's another language which provides a platform for faster time-to-market and feature iteration.

As mentioned elsewhere on this thread, and Java and PHP have their own distinct advantages also.

--LP

Perl is very useful (2, Insightful)

PerlPunk (548551) | more than 12 years ago | (#4033212)

Perl & Apache is an excellent combination for bringing sanity to legacy systems.

As far as dealing with legacy systems, nothing is better than Perl. For example, in a project I'm working on, in my company there is a vast array of legacy tools which require using telnet to get the work done. And the web interface I'm building (CGI & Net::Telnet) get's the work done beautifily. (Try doing this in PHP or Java.) The admin people are happy, and the development time so far has been almost negligible. Perl is the supreme glue language.

Load More Comments
Slashdot Login

Need an Account?

Forgot your password?