Can you tell me how to change from regular Perl to Mod_perl

P

Picker Leon

Do I just simple add a
use mod_perl;
then all my old perl program can work with mod_perl?

Any sample code is ok.

I looked at perl.apache.org, but could not find any sample codes.
 
P

Picker Leon

My webhost allows mod_perl and there is a perl dir in the html dir and I was
told that is where I put my mod_perl scripts to. I don't understand it. Do I
have to use mod_perl only in certain dir but not in all dir? I can use perl
in all dir now. Not sure if mod_perl is part of perl or part of apache.
 
T

Tore Aursand

Do I just simple add a
use mod_perl;
then all my old perl program can work with mod_perl?

No. Please read the documentation on http://perl.apache.org/ before you
continue asking. There's even a document describing how to migrate from
CGI to mod_perl on that site.
I looked at perl.apache.org, but could not find any sample codes.

That's bullshit, actually. No more, no less.
 
K

Keith Keller

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Do I just simple add a
use mod_perl;
then all my old perl program can work with mod_perl?

No. Read (carefully this time) the docs at perl.apache.org.
I looked at perl.apache.org, but could not find any sample codes.

mod_perl involves more than just code. Go back and read the docs.

- --keith

- --
(e-mail address removed)-francisco.ca.us
(try just my userid to email me)
AOLSFAQ=http://wombat.san-francisco.ca.us/cgi-bin/fom

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)

iD8DBQE/zumghVcNCxZ5ID8RAnD8AJsEFFK5Nggx8vUaSagVHhxJgLCc4QCeOuPz
BT9vCF7G2FYd4EKvznrkGu0=
=rSyG
-----END PGP SIGNATURE-----
 
T

Tore Aursand

what the f is mod perl anway?

Read the documentation next time. Don't know where to start? Google
should get you off, and the link to http://perl.apache.org/ in my previous
post should give you a clue.

For now, 'perldoc mod_perl' gives me this (and a lot more):

The Apache/Perl integration project brings together the full power of
the Perl programming language and the Apache HTTP server. This is
achieved by linking the Perl runtime library into the server and pro-
viding an object oriented Perl interface to the server's C language
API. These pieces are seamlessly glued together by the `mod_perl'
server plugin, making it is possible to write Apache modules entirely
in Perl. In addition, the persistent interpreter embedded in the
server avoids the overhead of starting an external interpreter and the
penalty of Perl start-up (compile) time.

In short, there are two major benefits from using mod_perl:

1. Speed (no need to load the Perl interpreter for each request)
2. Integration with the Apache web-server
 
P

Picker Leon

No. Please read the documentation on http://perl.apache.org/ before you
continue asking. There's even a document describing how to migrate from
CGI to mod_perl on that site.
I still could not find it. There are 1.0 2.0 docutmens and tutorio but
nothing as you said.
I see a lot of handlers in mod_perl, but I just want a simple way to change
my current scripts to mod_perl for faster time. The less change the better.
 
B

Ben Morrow

Picker Leon said:
I still could not find it. There are 1.0 2.0 docutmens and tutorio but
nothing as you said.

Then you have no imagination. I have never used mod_perl; just for the
hell of it I started at http://perl.apache.org/ and followed about
five obvious links; this got me to

http://perl.apache.org/docs/1.0/guide/porting.html#The_Script_Is_Too_
Dirty__But_It_Does_The_Job_And_I_Cannot_Afford_To_Rewrite_It_

(excuse the line-wrapping) which I believe tells you what you want to
know.

Ben
 
T

Tore Aursand

I still could not find it. There are 1.0 2.0 docutmens and tutorio but
nothing as you said.

Yes it is. Is it _really_ that hard to find it? Go to the following
address and be sure to read most of the documentation provided there:

http://perl.apache.org/docs/1.0/guide/index.html

When I was talking about migrating from CGI to mod_perl, I was referring
to the following document:

http://perl.apache.org/docs/1.0/guide/porting.html

Description: "This chapter is relevant to both writing a new CGI script or
perl handler from scratch and migrating an application from plain CGI to
mod_perl."
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top