Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation

mod_perl question

by peppiv (Curate)
on Jul 22, 2002 at 14:17 UTC ( #184058=perlquestion: print w/replies, xml ) Need Help??
peppiv has asked for the wisdom of the Perl Monks concerning the following question:

I am running Linux/Apache with mod_perl 1.26. Well, I'm not actually running mod_perl yet. I've been to and it taught me a great deal. I'm ready to take the next leap but as I understand it, I have to change this:

Alias /perl/ /home/stas/modperl/ PerlModule Apache::PerlRun <Location /perl/> SetHandler perl-script PerlHandler Apache::PerlRun Options ExecCGI PerlSendHeader On allow from all </Location>

I've copied my perl scripts to the new directory but I'm hesitant to push the 'button'. I don't have a development box - this is our 'In house' web server! Is there anyway to test one or two scripts with mod_perl before I take the complete leap?

Every scripts has been written under the strict pragma so as I understand it they should work ok.

Anyone have any thoughts on this?


Hey, I've been able to talk our company into being our own web host -> dedicated T1, apache/linux and I write every application in Perl! Score one more for us!

Replies are listed 'Best First'.
Re: mod_perl question
by perrin (Chancellor) on Jul 22, 2002 at 15:34 UTC
    Don't play games with your live server. It's easy to start a testing server on a separate port like 8080 and play with mod_perl there. This too is covered in the docs at

    Despite attempts to handle as broad a range of scripts as possible, Apache::PerlRun is still just a compatibility layer. There are plenty of things you could do in your code that will work fine under CGI but fail with PerlRun.

Re: mod_perl question
by simeon2000 (Monk) on Jul 22, 2002 at 14:37 UTC
    I think you're safe with that setup. Unless you're particularly worried about mod_perl crashing apache. Assuming you use /cgi-bin for your current production directory, mod_perl won't touch your production code. Only scripts put in the /perl directory will invoke mod_perl.

    At a later time you may decide to make mod_perl handle ALL *.pl|cgi scripts, but with THAT setup only files in /perl will be mod_perl'd.

    "Falling in love with map, one block at a time." - simeon2000

Re: mod_perl question
by rdfield (Priest) on Jul 22, 2002 at 14:36 UTC
    There should be a file called "" in your cgi-bin directory. Just amend the settings for your cgi-bin location to use PerlRun or Registry. A reasonable output page should result (and it will also confirm that you're using mod_perl). Next would be to copy a couple of standalone stripts that you've written into the directory...and see how they go.


Re: mod_perl question
by Cine (Friar) on Jul 22, 2002 at 17:19 UTC
    As you say yourself, they should work. However there is nothing stopping you from using mod_perl while still using your scripts as plain CGI scripts. You then have time to test each script running under mod_perl and CGI to see if there are any regressions. Even using strict it is my observation that some variables are not always reset when the script is continually running, and thus you should either change your script or use Apache::PerlRun instead.

    T I M T O W T D I
Re: mod_perl question
by Felonious (Chaplain) on Jul 23, 2002 at 04:41 UTC
    Is there anyway to test one or two scripts with mod_perl before I take the complete leap?

    Can't test it to verify at the moment, but maybe this is what your looking for:

    <Files> SetHandler perl-script PerlHandler Apache::PerlRun Options ExecCGI PerlSendHeader On allow from all </File>
    -- O thievish Night, Why should'st thou, but for some felonious end, In thy dark lantern thus close up the stars? --Milton

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://184058]
Approved by broquaint
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (2)
As of 2017-10-23 06:24 GMT
Find Nodes?
    Voting Booth?
    My fridge is mostly full of:

    Results (277 votes). Check out past polls.