perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Scott Gifford <sgiff...@suspectclass.com>
Subject Re: live and dev versions of a module on the same server
Date Sun, 05 Oct 2008 03:21:10 GMT
"Perrin Harkins" <perrin@elem.com> writes:

> On Fri, Oct 3, 2008 at 4:25 PM, Phil Carmody <thefatphil@yahoo.co.uk> wrote:
>> I presume that all hosting services which offer LAMP do so via virtual machines then,
or via Apache 2.
>
> No, they typically just offer CGI.  This is not an issue with CGI
> because you're spawning a whole new Perl interpreter for every
> request.  For mod_perl or FastCGI you need to use one of the
> suggestions in this thread.

And the interesting thing about CGI and mod_perl being basically
independent is that running your development code as a CGI script is a
great way to test it.  I write my code using CGI.pm, which will use
mod_perl if it's run under mod_perl, or act as a regular CGI script if
it is not.  If the development version of my script is run, it adds
the development library path to @INC (with "use lib"); otherwise it
adds the production library path.  Between those two things I get a
development environment which is basically seperate from my production
environment, although it is much slower.  I have had very good luck
with this approach.

Still, I keep another Apache instance around to do the final testing.
That's useful too, especially on the rare occasion that the behavior
is different.

----Scott.

Mime
View raw message