You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Tyler MacDonald <ty...@yi.org> on 2005/10/31 20:57:34 UTC

ModPerl::PackageRegistry 0.01 released (was Re: registry agony continues...)

	What a fun problem to solve. Instead of banging my head against the
wall trying to get things to compile at runtime, I stopped using
ModPerl::Registry entirely and switched to defining my own pacakges with
handlers. Problem solved. Of course, how do I map these things to URLs now?
I ended up writing this:

	http://search.cpan.org/~CRAKRJACK/ModPerl-PackageRegistry-0.01/

	It maps /my/page.pl to MyWebsite::pages::my::page->handler(). It was
also an opportunity to play around with Apache::Test (which is really sleek,
by the way), and make my website even faster.

> If you load the modules in a startup file:
>   use DBI;
>   use LWP::UserAgent;
>   use Time::ParseDate;
> do you get a similar error (after stopping and starting
> the server, for the changes to take effect)?

	What I've done for my site is made a "yi::pages" module, which is
loaded on apache startup, and loads all of the "yi::page::" modules which
define the dynamic pages for my website... so of course, all their
dependancies get pulled in too. Loading those modules in the startup file
would probably have solved 90% of the problem, but there was still the
occasion where the registry script itself was having bizarre problems
(thining $r was a global symbol when it was instantiated as "my $r", etc...)

> Also, as a sanity check, does
>    perl -c PayPal_IPN.pl
> pass?

	Absolutely. That code was working fine for 3 years under mod_per
1.99. It wasn't until the move to mod_perl 2.0.2 these strangeness started
appearing. And if I get rid of ModPerl::Registry and precompile everything,
well, I've been tailing my access_log for two days and haven't seen a single
unexpected error 500 yet. :-)

	- Tyler


Re: ModPerl::PackageRegistry 0.01 released (was Re: registry agony continues...)

Posted by Tyler MacDonald <ty...@yi.org>.
Perrin Harkins <pe...@elem.com> wrote:
> > 	http://search.cpan.org/~CRAKRJACK/ModPerl-PackageRegistry-0.01/
> See also, Apache::Dispatch.  Not ported to mp2 yet, I think.

	Nice. :-) Geoffrey is using a slightly different model than me
(having multiple pages inside one class, different index handling, and some
interesting looking pre/post hook stuff, no visible support for mixing
static and dynamic content) so I don't feel like I've completely wasted my
time writing this... not that I would have anyways, I learned a thing or two
as well!

	Cheers,
		Tyler


Re: ModPerl::PackageRegistry 0.01 released (was Re: registry agony continues...)

Posted by Perrin Harkins <pe...@elem.com>.
On Mon, 2005-10-31 at 11:57 -0800, Tyler MacDonald wrote:
> 	What a fun problem to solve. Instead of banging my head against the
> wall trying to get things to compile at runtime, I stopped using
> ModPerl::Registry entirely and switched to defining my own pacakges with
> handlers. Problem solved. Of course, how do I map these things to URLs now?
> I ended up writing this:
> 
> 	http://search.cpan.org/~CRAKRJACK/ModPerl-PackageRegistry-0.01/

See also, Apache::Dispatch.  Not ported to mp2 yet, I think.

- Perrin