Web Developer's Virtual Library: Encyclopedia of Web Design Tutorials, Articles and Discussions
 Discussion Forums
 HTML, XML, JavaScript...
 Software Reviews
 Editors,Others...
 Top100
 JavaScript Tutorials, ...
 Tutorials
 ASP, CSS, Databases...
 Discussion List
 FAQ, Roundup, Configure ...
 Authoring
 HTML, JavaScript, CSS...
 Design
 Layout, Navigation,...
 Graphics
 Tools, Colors, Images...
 Software
 Browsers, Editors, XML...
 Internet
 Domains, E-Commerce, ...
 WDVL Resources
  Intermdiate, Tutorials,...
 WDVL
 Discussion Lists, Top 100,...
 Technology Jobs


WDVL Newsletter

Active Server Pages
JSP/Java Servlets
Microsoft SQL Server
Daily Backup
Dedicated Servers
Streaming Audio/Video
24-hour Support    

jobs.webdeveloper.com

Hiermenus


e-commerce
Partner With Us















Developer Channel
FlashKit.com
JavaScript.com
JavaScriptSource
Developer Jobs
ScriptSearch
StreamingMediaWorld
Web Developer's Journal
Web Developer's Virtual Library
WebDeveloper.com
Webreference
Web Hosts
XMLfiles.com

internet.com
IT
Developer
Internet News
Small Business
Personal Technology
International

Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers


Top 10 Articles
  1. Web Developer's Virtual Library: Encyclopedia of Web Design Tutorials, Articles and Discussions
  2. JavaScript Tutorial for Programmers
  3. Design
  4. JavaScript Tutorial for Programmers - Objects
  5. JavaScript Tutorial for Programmers - JavaScript Grammar
  6. JavaScript Tutorial for Programmers - Versions of JavaScript
  7. Cascading Style Sheets
  8. JavaScript Tutorial for Programmers - Embedding JavaScript
  9. JavaScript Tutorial for Programmers - Functions
  10. Authoring JavaScript
Domain Name Lookup
Search to find the availability of a domain name. Just enter the complete domain name with extension (.com, .net, .edu)

Who's Afraid of Perl?

April 26, 1999

Many Perl practitioners are zealots for the cause -- Perl has evolved into a near-religion for many programmers. The great advantage of this is that there are many folks out there who sincerely believe in the language and work hard on its behalf in continued support and development. The disadvantage of this zealotry is a somewhat Hare Krishna-esque style of evangelism which may intimidate many newcomers. Perl "mongers", as they like to be known, find great pleasure in maximizing their use of this tool, which often comes out in the form of incredibly cryptic Perl programs which pack extreme amounts of processing into small amounts of code.

A typical Perl monger, for example, will while away the better portion of a weekend in a darkened room and proudly produce the following gem:

$*=q^00$2b{29}2a;30$17>24&25*2a(1e)1b;
28+1d-26/1b=28+22*1c(1e)17;19@21^, $*.="[1b]28";
$z="";@%=split/\W/,$*;@_=map{hex}@%;
for(@_){$_=chr($_+74);s%[zgf]%$z%g;my$t=$_;push@#,sub{$t};}
for(@#){print&$_}0xf00f&print$/;

Scary stuff! What does it do? I have no idea! However, this is the kind of Perl that Perl mongers love to show off as to why Perl is so great. Unfortunately, well-meaning though they may be, Perl mongers often lack the ability to empathize with normal humans, to whom the above code provides every reason to find a different line of work. Such as botany.

Beginner's can take solace -- Perl programs need not be cryptic at all; in fact, they can be quite logical and easy to understand. Although such a style may not leverage the full power of Perl, it does wonders to improve the relationship between Perl and human, and this tutorial will definitely favor legible, clear code over the Perl monger style.

 

Why Perl and CGI

Web developers most frequently use Perl in the context of CGI. CGI has been overdescribed to the point of vagary and mystery for many new developers, but the concept is quite simple: the user provides some information on the web page and the browser sends this information to the web server. The web server passes this information to a particular program, this program "does a bunch of stuff" with the information, returns some results to the web server, which passes the results back to the user's browser.

CGI, which translates to "Common Gateway Interface", simply defines the means by which the user's data passes from the web server to the processing program and back. That's basically all you need to know about the internal guts of CGI.

The key idea to take away from this is that the program which "does a bunch of stuff" with the user's data can be written in any computer language which runs on the server and can communicate with the server via CGI.

Enter Perl -- Perl can "speak" CGI fluently and happens to be well-suited to manipulating data, which is exactly why Perl is the most common language used in developing CGI interactions.

CGI and Perl are such a powerful combination because, leveraged on the flexibility of Perl, almost any conceivable type of processing can constitute the "does a bunch of stuff" portion of the CGI interaction. Thus, when the Perl program receives the user's data it could follow any number of paths, from retrieving information from a database to constructing and delivering whole new web pages on-the-fly (known as "dynamic content").

But let's not overwhelm. First we'll look at using Perl to build some simple programs and then we'll see how to tie these programs into CGI interactions over the Web.

The Perl You Need to Know
The Perl You Need to Know
Getting Perl


Up to => Home / Authoring / Languages / Perl / PerlfortheWeb




Jupiter Online Media: internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and Jupiter Online Media

Jupitermedia Corporate Info


Legal Notices, Licensing, Reprints, & Permissions, Privacy Policy.

Web Hosting | Newsletters | Tech Jobs | Shopping | E-mail Offers