I'm going to talk about 3 issues here: namespace, prerequisite and CPAN
listing. All related to a single issue, a smooth move into the next
generation of mod_perl with as little confusion created as possible.

=head1 namespace

I think we've discussed this slightly before, but I wonder whether we want
to reserve Apache2:: namespace and have all the ported modules to move
into Apache2:: namespace, so it:

 -- will not confuse users about whether the modules works with 2.0 only
 -- force the authors to review their code in order to make it complient
    with 2.0

I'm talking mainly about modules like Apache::Filter, Apache::Scoreboard
and similar which are tightly tied to mod_perl-1.3. I can foresee many
unncessary question on the list, because people will use wrong versions of
the modules.

The same goes for mod_perl-2.0 core modules. Having Apache2:: and Apache::
will allow to have both servers under the same /usr/lib/perl5 and will
allow OS distro to ship both versions and have them non-self-exclusive.

The only drawback is forgetting to type '2' when coding.



=head1 prerequisite

Another issue is having an unambiguous way to require a correct context
with something like:

Apache.pm:
----------
sub require_mod_perl2 { 1; }

So if in your modules which work only with mod_perl-2.0 you will write:

Apache::KillerApp:
------------------
use strict;
Apache::require_mod_perl2();

and if the code is not running under mod_perl, this method will be simple
not available.

I prefer to have a standard accepted documented way to do that, rather
everyone trying to implement their own.

Also it would be nice to add now a method to 1.3 which will be also used
in 2.0 and allow to retrieve the version number easier than doing re:
$ENV{MOD_PERL} =~ /2/

this or similar technique will allow authors to have their code
working under 2.0 and 1.3, out of mod_perl. e.g.:

  if (defined MOD_PERL_VERSION) {
      if (defined MOD_PERL_VERSION >= 3.0) {
        # 3.0 specific code
      } elsif (MOD_PERL_VERSION >= 2.0){
        # 2.0 specific code
      } else {
        # 1.x specific code
      }
  } else {
    # non mod_perl code
 }

(yeah, I do look forward into 3.0. Just like some people are still using
perl4, while perl6 is under development, there will be still people using
mod_perl-1.x, when we will talk about mod_perl 3.x.)

Until now a mere checking of $ENV{MOD_PERL} to figure out whether we are
in the mod_perl environment was good enough, but not anymore since we have
to be able to differentiate between 1.x and 2.x now, and using regex on
$ENV{MOD_PERL} is ugly and error prone.  MOD_PERL_VERSION constant seems
like a much nicer way to do this.


=head1 CPAN listings

In any case we will have to start a new list of modules on
perl.apache.org, and list modules which work with 2.0 (and possibly with
1.3).

_____________________________________________________________________
Stas Bekman              JAm_pH     --   Just Another mod_perl Hacker
http://stason.org/       mod_perl Guide  http://perl.apache.org/guide
mailto:[EMAIL PROTECTED]   http://apachetoday.com http://eXtropia.com/
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to