Apache-ASP

 view release on metacpan or  search on metacpan

site/articles/perlmonth1_intro.html  view on Meta::CPAN


<html>
<head><title>Introduction to Apache::ASP</title></head>

<body bgcolor=white>

<h2>Introduction to Apache::ASP</h2>

<h3>By: Joshua Chamas</h3>

<i>published in PerlMonth.com in 1999</i>
<p>

I was first drawn to Active Server Pages (ASP) as a web development
platform a couple years ago when researching how to best develop the 
<font size=-1><a href=http://www.nodeworks.com>NODEWORKS</a></font> web site.  I needed 
something maintainable, powerful, fast, portable, and of course perl.
<p>
Microsoft had developed the ASP standard as the end all to web
application development, which promised to be maintainable, powerful,
and fast.  But support for perl under PerlScript was shoddy, VBScript, 
ASP's native tongue, seemed a pathetic alternative, and an NT/IIS solution lacks a certain 
portability.  Thus I was led to developing <a href=http://www.apache-asp.org>Apache::ASP</a>, 
which runs under Doug MacEachern's <a href=http://perl.apache.org>mod_perl</a> 
for <a href=http://www.apache.org>Apache</a>.

<h3>Maintainable</h3>

I had been doing CGI style web applications for a couple of years already, 
and had never been quite satisfied with the CGI programming, 
growing less so as the HTML I was working with became increasingly more 
complex than the CGI it was embedded in.  The idea of embedding the scripting 
within the flow of the HTML seemed like a more natural fit over time.
This natural flow speaks to the heart of <b>maintainability</b>,
where another developer can pick up your code and get a feel for
it on the first read.
<p>
Check out the difference in how it feels to embed the HTML
in the scripting, versus embedding the scripting in the HTML.
A reasonably complex table, which is structurally HTML heavy,
only touches the tip of the iceberg:
<p>
<table border=2 bgcolor=blue>
<tr><td>
        <table border=4 bgcolor=white>
        
            <tr><td>SOME</td></tr>
            
            <tr><td>DATA</td></tr>
             
                </table><td><table border=4 bgcolor=white>
                
            <tr><td>TO</td></tr>
            
            <tr><td>LOOP</td></tr>
             
                </table><td><table border=4 bgcolor=white>
                
            <tr><td>OVER</td></tr>
            
            <tr><td>:)</td></tr>
            
        </table>
</td></tr>
</table>
<p>
Coding this table in CGI, you might get:
<pre>
<hr width=90% size=1>
use CGI qw/:standard *table/;
my(@data) = (&#39;Some&#39;, &#39;Data&#39;, &#39;To&#39;, &#39;Loop&#39;, &#39;Over&#39;, &#39;:)&#39;);
print 
  header,
  start_html(&#39;Example&#39;),
  start_table({-border=&gt;2, -bgcolor=&gt;&#39;blue&#39;}),



( run in 0.449 second using v1.01-cache-2.11-cpan-d8267643d1d )