All the scripting languages like python, php, ruby, and perl are mature 
and good to build robust, dynamic website.  Perl is a good choice for 
anyone wanting to build a fast, scalable internet or Intranet 
application that is accessed via a web browser.  The perl application 
when written cleanly will run under both perl or mod_perl.

An application running under mod_perl will run 200 to 2,000 times faster 
than under regular perl.  Mod_perl has been closely coupled to the 
Apache Web Server, which enjoys over 60% of the web server space.

Mod_perl is an executable that runs persistently within Apache, 
something like FoxPro's runtime.  When a perl module is called by 
Apache, it is compiles into binary and cached into memory.  By 
specifying Apache::DBI be used in the perl script, Apache will create a 
persistent connection to a PostgreSQL, MySQL, other databases.

All this adds up to web pages that display in a blink and scale even on 
modest hardware.  It is no longer necessary to compile special versions 
of the related apps.  All I had to do in Fedora 13 was select mod_perl 
from the Add/Remove software menu, and mod_perl installed and was ready 
to go.  Its really simple now.

Mod_perl gives the programmer full access to Apache's APIs, and perl 
code can even be place in the Apache httpd.conf file.

Here is an example where I create paths in httpd.conf file.

#------------------------  ssl.conf -------------------------------


     PerlOptions +SetupEnv
     PerlModule ModPerl::Registry
<Location /sm_demo/>
         SetHandler perl-script
         PerlResponseHandler ModPerl::Registry
         PerlOptions +ParseHeaders
         PerlSetEnv MYLIB /var/www/karts/sm_demo/Sm
         PerlSetEnv MY_CONFIG_FILE /var/www/karts/sm_demo/conf/kart_config
         Options +ExecCGI
         Order allow,deny
         Allow from none
         PerlSendHeader On
</Location>

#------------------  end ssl.conf  -------------------------------

Here are example of using the variables in my perl code:

The following code looks to see if the MYLIB Apache environment variable 
is defined.  If it is, the fully qualified path to my perl classes is 
added to perl's @INC paths.  If not, (eg the program is running under 
normal perl), the relative path "SM" is added to perl's @inc paths.

     use lib $ENV{MYLIB} || 'Sm';

The following code check to see if we have the Apache environment 
variable $ENV{MY_CONFIG_FILE}.  If true the file handle SMCONFIG is 
created using the Apache MY_CONFIG_FILE variable, which holds the fully 
qualified path to the app's configuration file.  If false, (eg running 
under normal perl), the relative path is used.


     if ( $ENV{ MY_CONFIG_FILE })
     {
         open SMCONFIG, "$ENV{ MY_CONFIG_FILE }" or die;
     }
     else
     {

         open SMCONFIG, "conf/kart_config" or die
     }

http://perl.apache.org/

Regards,

LelandJ




On 03/17/2011 01:14 AM, william tormey wrote:
> Hi All: I am in Bronxville NY for 3 weeks starting April 13th. Having
> just peeked through the mist and sighted land beyond my port project (C
> and Clipper to VFP), I have begun to think of what language I should
> learn considering I must start all over again, a for Internet and b for
> off line applications relating  to Dedicated Business Systems and
> Process Control.
>
> If there is any gathering related to VPF and or the above query in the
> greater New York area during my stay I should love to know of it.
>
> TIA
> William Tormey,
> American Microcomputers
> Ireland
>
>
[excessive quoting removed by server]

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/[email protected]
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to