Stas Bekman <[EMAIL PROTECTED]> writes:
We have a problem with using the Apache::Test name, more correctly we have a problem with using the Apache/Test.pm filename. On platforms with case-insentive filesystems (winFU, Mac OS X) if mod_perl 1.x is installed, there is Apache/test.pm (notice the lower case 't'). So when you say 'use Apache::Test' it loads Apache::test. Boom, nothing works.
There are several routes we can take to resolve this problem:
1. rename Apache::Test to something else. David Wheeler has proposed to use Apache::Tester (or even swap the sides: Test::Apache).
2. add a new package Apache::TestLoad which will deal with loading the right Apache::Test package, by replacing 'require Apache::Test' with search for 'Apache/Test.pm' in @INC and doing do $file; on the full path. That solves the problem, of loading the right file but you will have to replace all instances of 'use Apache::Test;' with 'use Apache::TestLoad;', but still using the functions from Apache::Test. Since they are all imported by default, this is not a big issue. It's just confusing that use 'Apache::TestLoad'.
I like using the idea of using/reserving Test::Apache here. Why not combine options 1 & 2 by making Test::Apache the package loader for Apache::Test (ie, instead of Apache::TestLoad)? That way, 3rd party modules that have problems with Apache::test can use Test::Apache, and httpd-test development can continue within the Apache::Test namespace.
The problem is that *all* 3rd party modules which use/plan to use Apache::Test
have this problem. They might not be aware of it, because they either aren't running WinFU/OSX or they don't have mp1 installed.
Seems like a workable compromise to me: if all we have to do is
s/Apache::Test/Test::Apache/ for libapreq-1.x, that seems easy enough.
That has the same problem as s/Apache::Test/Apache::TestLoad/, you load one package but use the other.
As of this moment I think the best solution is to extend Apache::Test to support Apache::test and make sure that the installed Apache/test.pm is removed/replaced. The only drawback with this approach (other than the need to code it) is that if someone installs an older mp1 after installing Apache::Test they will install Apache/test.pm. I assume that the next version of mp1 will be aware of Apache::Test.
__________________________________________________________________ Stas Bekman JAm_pH ------> Just Another mod_perl Hacker http://stason.org/ mod_perl Guide ---> http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com