[Kc] Decoupling HTTP and interface
Frank Wiles
frank at wiles.org
Mon Mar 24 12:47:12 PDT 2008
On Mon, 24 Mar 2008 14:08:04 -0500
"Kit Peters" <popefelix at gmail.com> wrote:
> So I'm building a RESTful server in Perl to run under Apache2 and
> mod_perl 2. And it occurs to me that my favorite method of debugging,
> perl -d, is not available in this setup, as all the Perl code is being
> executed by Apache and mod_perl, which are setting up their own
> environment that I can't duplicate easily. So then it occurs to me
> that the better thing to do would be to work out the behaviour outside
> of Apache and mod_perl altogether. I could then just make up GET
> strings on the command line or whatever. For Apache's part, I could
> write my mod_perl handlers to call the subs from my text interface.
>
> So, before I go reinventing the wheel, has anyone done this already?
> Is there some code out there already that I can integrate into this
> project?
You can use Apache::DB from CPAN to allow you to do debugging
on a mod_perl process. I happen to be the maintainer of that
module these days, so let me know if you have any problems. ( FYI
it doesn't work with Perl 5.10 yet, I haven't had a chance to
sort out the bugs ).
One bit of advice however, make sure you run httpd -X so that
every browser request goes to the same backend of you'll drive
yourself nuts.
But yes, in general you want to use a framework like Catalyst,
Jifty, Gantry, etc. which do a lot more for you than just
make debugging a bit easier.
-------------------------------------------------------
Frank Wiles, Revolution Systems, LLC.
Personal : frank at wiles.org http://www.wiles.org
Work : frank at revsys.com http://www.revsys.com
More information about the kc
mailing list