Complete.Org: Mailing Lists: Archives: linux-help: November 2002:
[linux-help] Re: Perl Question
Home

[linux-help] Re: Perl Question

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: linux-help@xxxxxxxxx
Subject: [linux-help] Re: Perl Question
From: Steven Saner <ssaner@xxxxxxxxxxxxxxx>
Date: Sun, 17 Nov 2002 01:40:46 -0600
Reply-to: linux-help@xxxxxxxxx

On Sun, Nov 17, 2002 at 12:07:35AM -0600, Lars von dem Ast wrote:
> 
> All right then, what's so great about PHP? (I don't really know anything
> about it, but to me anything where code is embedded in HTML seems so
> primitive. Total dynamic page generation (as done with CGI) still seems the
> sleekest, best way. Or am I missing something? And PHP is yet another
> language to learn! With Java and Perl Web stuff you've got languages that
> can be used in other non-Web situations, too. Does PHP have a stand-alone
> language? Plus how do you scale with PHP or anything that is strictly
> embedded code in HTML? (I'm being curious, not offensive here.)

Well, each to his own, of course, but CGI really is the more
primitive. The thing with CGI is that you have to create each dynamic
web page, in its entirety programatically. This can get kind of
difficult after a while. It also does not lend itself very well to a
situation where you have some people who are good at web design (look
and feel) and some people who are good at programming. If a web
designer comes up with some HTML and gives it to you, you then have to
convert all of that HTML into print statements for your CGI, that can
be difficult. And in my opinion the result isn't very sleek, because
the code doesn't hardly look like HTML anymore.

The a templating concept, such as PHP, you start with HTML, which is
really what you want when it is all said and done anyway. You then
insert code into the places that need to have dynamic content. Also,
with something like PHP a single page can be generated from multiple
files, so you can separate constant elements (like a header and
footer) from dynamic elements (like a table build from data in a
database) and glue them all together.

That said, I don't really like PHP either. In part because it is, as
you say, another language to learn. Also, since I am a perl
programmer, I have a lot of libraries and stuff in perl that I want to
use and it is difficult to do that within PHP. There are other options
than PHP, and one that I like very much is Mason (www.masonhq.com).
Mason is a templating system, much like PHP, but it is perl. This
means that the code that is embedded in HTML is plain old perl. Also,
I can use any perl library that I have written, or from CPAN and embed
it into HTML. It also runs under mod_perl with the Apache web server,
so performance is much better than the old standard CGI. There is a
new OReilly book on Mason that a couple of the core members of the
development team wrote, if you are interested. I do virtually all of
my web development based on Mason now.

Steve

-- 
--------------------------------------------------------------------------
Steven Saner <ssaner@xxxxxxxxxxxxxxx>
-- This is the linux-help@xxxxxxxxx list.  To unsubscribe,
visit http://www.complete.org/cgi-bin/listargate-aclug.cgi


[Prev in Thread] Current Thread [Next in Thread]