You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by angie ahl <an...@gmail.com> on 2005/04/20 19:31:16 UTC

[MP2] Import Apache with @ISA

Hi guys

I'm having a pickle with trying to importing Apache:

I'm following the example in the Mod Perl Cookbook (v1) and looked at
the code samples from the book online.

httpd.conf has this:
________________________
PerlSwitches -Mlib=/Library/Webserver/Documents/mymod/perl

   PerlModule ModPerl::Registry
   PerlModule mymod::hook

<FilesMatch "\.html$">
	SetHandler perl-script 
	Perlhandler mymod::hook->handler
</FilesMatch>
________________________

________________________
package mymod::hook;

use strict;
use warnings;

use Apache::Constants qw(:common);
use HTML::Template;
use mymod::Apache;

use utf8;
use Encode qw/is_utf8 decode encode/;
binmode(STDOUT, ":utf8");

sub handler {
	my $r = mymod::Apache->new(shift);

	$r->content_type('text/html'); # do output of header
	
	print $r->uri;
	return Apache::OK;
}

1;
________________________

________________________
#!/usr/bin/perl
package mymod::Apache;

use Apache;

use DynaLoader;

use strict;

our @ISA = qw(DynaLoader Apache);

sub new {

  my ($class, $r) = @_;

  $r ||= Apache->request;

  return bless { r => $r }, $class;
}
1;
________________________


I get an error stating "Can't locate auto/mymod/Apache/content_typ.al in @INC"

Any idea what I'm missing? Is this another one of those things that's
changed in MP2 ?

TIA

Angie

Re: RC5 really broke some stuff

Posted by Adam Kennedy <ad...@phase-n.com>.
> I don't know the full story, but I am pretty sure that the movers and 
> shakers in the decision team have a strong point for it (possibly 
> documented in perl.apache.org). It's caused me unexpected pain recently 
> as well; and I have to spend today as well working through my codes 
> because of it. But I am glad that people like Randy, Markus, and the 
> documentation team (@perl.apache.org) have jumped in to help stranded 
> people like me ('cos my job depends on my product!). Thanks guys!

The shortest version I can give for in explanation us

- mod_perl2 is a new API compared to mod_perl1
- The implementation was kept in the same Apache:: namespace
- It was demonstrated that this caused some large long term problems
- Most were unfixable once mod_perl2 became "stable and supported"
- The most favoured solution was to move to Apache2::
- This would cause pain for early adopters (but only once)
- Final decision was to let early adopters "take the hit" now, to 
prevent the long term problems on the entire userbase.

> My only wish is that there will be no more changes to the libraries in 
> such extent. After all, if this is the best way to move (mod_)perl 
> forward, we must all bite the bullet at one time or another.

Yes, it's a one time only change.

Adam K

Re: RC5 really broke some stuff

Posted by "Philip M. Gollucci" <pg...@p6m7g8.com>.
Tom Schindl wrote:
> Not right. You could use the multienv-branch of libapreq.
> 
> Tom
Not true.  Trunk was moved to a dead branch and this branch was moved to 
trunk in its place.  You should use trunk. The multienv-branch nolonger 
exists.

This happened Monday evenging.

libapreq2(trunk) + mp2 RC5 is the combo you want.


-- 
END
------------------------------------------------------
Philip M. Gollucci (pgollucci@p6m7g8.com) 301.254.5198
Consultant / http://p6m7g8.net/Resume/resume.shtml
Senior Developer / Liquidity Services, Inc.
	http://www.liquidityservicesinc.com

Re: RC5 really broke some stuff

Posted by Tom Schindl <to...@gmx.at>.
jonathan vanasco wrote:

>
> Its pretty well documented everywhere -- including the  announcement 
> and install instructions
>
> libapreq does not work right yet.  if you're dealing with production 
> or stability sensitive stuff, i'd suggest keeping a copy of RC4 
> running and development on that release, then reading the migration 
> instructions to the new API once everything is sorted out.
>
Not right. You could use the multienv-branch of libapreq.

Tom

Re: RC5 really broke some stuff

Posted by jonathan vanasco <jv...@mastersofbranding.com>.
On Apr 21, 2005, at 2:17 AM, Foo Ji-Haw wrote:

> People like Jonathan and myself just have to double up (or triple-up!) 
> because of the change. Try telling that to your bosses that the latest 
> version of modperl is holding things back ('told you we should've used 
> Java!').


On Apr 21, 2005, at 1:14 AM, Perrin Harkins wrote:

> It would be nice if some of the users who were so vocal about 
> demanding this change a few months ago would help with the patching 
> fun, or at least help explain to people like Jonathan and Ji-Haw why 
> it needed to happen.

I'm not 'doubled up' though -- RC5 didn't have the CPAN/libaprq stuf i 
needed working yet on my platforms, so I just backported to get on with 
things.   I really wish I could help out with the porting over -- I'm 
just knee deep in my own code and trying to get a project out the door  
before I leave NYC for a week in LA.


Re: RC5 really broke some stuff

Posted by "Philip M. Gollucci" <pg...@p6m7g8.com>.
Foo Ji-Haw wrote:
> 5.9.3? Isn't the next official Perl version 5.10?
Yes, this is unofficial bleedperl gotten via rsync.

5.8.6 will support the same configuration.
I've not tried 5.6.2 yet....

-- 
END
------------------------------------------------------
Philip M. Gollucci (pgollucci@p6m7g8.com) 301.254.5198
Consultant / http://p6m7g8.net/Resume/resume.shtml
Senior Developer / Liquidity Services, Inc.
	http://www.liquidityservicesinc.com

Re: RC5 really broke some stuff

Posted by Foo Ji-Haw <jh...@nexlabs.com>.
5.9.3? Isn't the next official Perl version 5.10?

Philip M. Gollucci wrote:

>> It would be nice if some of the users who were so vocal about 
>> demanding this change a few months ago would help with the patching 
>> fun, or at least help explain to people like Jonathan and Ji-Haw why 
>> it needed to happen.
>>
>> - Perrin
>
> Actually, I'd say that the developement is moving unimaginably fast!
> Keep it up. Thanks Guys!
>
> I've got httpd 2.1.5-dev with mp2 1.99923 and libapreq2(trunk)
> and perl 5.9.3 with ithreads and all.
>
> Apache::DBI seems to be working with my patches
> CGI.pm 3.08 just got released
>
>
>

Re: RC5 really broke some stuff

Posted by "Philip M. Gollucci" <pg...@p6m7g8.com>.
> It would be nice if some of the users who were so vocal about demanding 
> this change a few months ago would help with the patching fun, or at 
> least help explain to people like Jonathan and Ji-Haw why it needed to 
> happen.
> 
> - Perrin
Actually, I'd say that the developement is moving unimaginably fast!
Keep it up. Thanks Guys!

I've got httpd 2.1.5-dev with mp2 1.99923 and libapreq2(trunk)
and perl 5.9.3 with ithreads and all.

Apache::DBI seems to be working with my patches
CGI.pm 3.08 just got released



-- 
END
------------------------------------------------------
Philip M. Gollucci (pgollucci@p6m7g8.com) 301.254.5198
Consultant / http://p6m7g8.net/Resume/resume.shtml
Senior Developer / Liquidity Services, Inc.
	http://www.liquidityservicesinc.com

Re: RC5 really broke some stuff

Posted by Stas Bekman <st...@stason.org>.
Jie Gao wrote:
> 
> 
> On Fri, 22 Apr 2005, Carl Johnstone wrote:
> 
> 
>>Date: Fri, 22 Apr 2005 11:02:48 +0100
>>From: Carl Johnstone <mo...@fadetoblack.demon.co.uk>
>>To: modperl@perl.apache.org
>>Subject: Re: RC5 really broke some stuff
>>
>>
>>
>>>People like Jonathan and myself just have to double up (or triple-up!)
>>>because of the change. Try telling that to your bosses that the latest
>>>version of modperl is holding things back ('told you we should've used
>>>Java!').
>>
>>Did your boss know that the "latest" version of mod_perl is actually a
>>pre-release?
>>
>>I'll agree that pre-release is a bad time to make API changes like this and
>>it would be better if it'd be done during the beta. It's only when a piece
>>of software is released that the developers are making the implicit promise
>>to not break anything.
>>
>>If you're going to run beta or pre-release code - you've got to accept the
>>risks that go with that.
> 
> 
> I think we all knew this. But rc4 was about the last one before formal release,
> and Stas promised since rc2 or something that there would be no API change (I'm
> not blaming him on this though). I've had rc4 in production for some time, and
> I'll have to keep it possibly for a very long time to come.

Stas promised and kept his promises, until he was overruled by the 
majority of developers who decided to break his promises. But it's a 
history now. What's done is done. Moving on.


-- 
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

Re: RC5 really broke some stuff

Posted by Fred Moyer <fr...@taperfriendlymusic.org>.
>>If you're going to run beta or pre-release code - you've got to accept the
>>risks that go with that.
> 
> I think we all knew this. But rc4 was about the last one before formal release,
> and Stas promised since rc2 or something that there would be no API change (I'm
> not blaming him on this though). I've had rc4 in production for some time, and
> I'll have to keep it possibly for a very long time to come.

I was thinking along those same lines this morning that I wouldn't move
from rc4 for a while.  I've got a small app that I've put together over
the past couple months.  But it was too much for me to resist trying out
this new release any longer and I ported my app today in about 30 minutes.

Most of that time was spent reading
http://perl.apache.org/docs/2.0/rename.html and the discussion threads
from the past week.  It was really easy.  A lot of the critical modules
such as CGI have been ported to work with rc5, and if you run into any
that aren't, it's easy to port those yourself for the most part.  For
what it's worth, I recommended making the move.  It's not as difficult
or time consuming as you may think.

- Fred

Re: RC5 really broke some stuff

Posted by Jonathan Vanasco <jv...@mastersofbranding.com>.
I felt that for a moment too, then I read up online and saw Stas and 
the other core developers thoughts as Perrin highlighted below.  I'm 
sure there could have been a million and one ways to delay the 
change... but they had a real imperative to do it as RC5.

Not to mention -- I'm really glad that we have this all over with, and 
we have all the new, more logical functionality, now -- as opposed to 
months or releases down the line.  As painful as the impact was, i 
think the benefits more than make up for it.

Thanks, RC5 Developers.


On Apr 24, 2005, at 12:55 PM, Perrin Harkins wrote:

> Jie Gao wrote:
>> I think we all knew this. But rc4 was about the last one before 
>> formal release,
>> and Stas promised since rc2 or something that there would be no API 
>> change (I'm
>> not blaming him on this though).
>
> Yes, please don't blame Stas for this.  None of us wanted to make this 
> change, and Stas was especially concerned about the impact on users.  
> It was not done lightly or without consideration for what it would 
> mean to people already running pre-releases.
>
> - Perrin


Re: RC5 really broke some stuff

Posted by Perrin Harkins <pe...@elem.com>.
Jie Gao wrote:
> I think we all knew this. But rc4 was about the last one before formal release,
> and Stas promised since rc2 or something that there would be no API change (I'm
> not blaming him on this though).

Yes, please don't blame Stas for this.  None of us wanted to make this 
change, and Stas was especially concerned about the impact on users.  It 
was not done lightly or without consideration for what it would mean to 
people already running pre-releases.

- Perrin

Re: RC5 really broke some stuff

Posted by Jie Gao <J....@isu.usyd.edu.au>.


On Fri, 22 Apr 2005, Carl Johnstone wrote:

> Date: Fri, 22 Apr 2005 11:02:48 +0100
> From: Carl Johnstone <mo...@fadetoblack.demon.co.uk>
> To: modperl@perl.apache.org
> Subject: Re: RC5 really broke some stuff
>
>
> > People like Jonathan and myself just have to double up (or triple-up!)
> > because of the change. Try telling that to your bosses that the latest
> > version of modperl is holding things back ('told you we should've used
> > Java!').
>
> Did your boss know that the "latest" version of mod_perl is actually a
> pre-release?
>
> I'll agree that pre-release is a bad time to make API changes like this and
> it would be better if it'd be done during the beta. It's only when a piece
> of software is released that the developers are making the implicit promise
> to not break anything.
>
> If you're going to run beta or pre-release code - you've got to accept the
> risks that go with that.

I think we all knew this. But rc4 was about the last one before formal release,
and Stas promised since rc2 or something that there would be no API change (I'm
not blaming him on this though). I've had rc4 in production for some time, and
I'll have to keep it possibly for a very long time to come.

Regards,


Jie

Re: RC5 really broke some stuff

Posted by Carl Johnstone <mo...@fadetoblack.demon.co.uk>.
> People like Jonathan and myself just have to double up (or triple-up!)
> because of the change. Try telling that to your bosses that the latest 
> version of modperl is holding things back ('told you we should've used 
> Java!').

Did your boss know that the "latest" version of mod_perl is actually a 
pre-release?

I'll agree that pre-release is a bad time to make API changes like this and 
it would be better if it'd be done during the beta. It's only when a piece 
of software is released that the developers are making the implicit promise 
to not break anything.

If you're going to run beta or pre-release code - you've got to accept the 
risks that go with that.

Carl


Re: RC5 really broke some stuff

Posted by Foo Ji-Haw <jh...@nexlabs.com>.
Thanks Perrin,

I will just like to say that this is a point in time when modperl 2 
developers are feeling pain right now. Documentation is good, and 
response on the mailing list is good. Things can always be better of course.

People like Jonathan and myself just have to double up (or triple-up!) 
because of the change. Try telling that to your bosses that the latest 
version of modperl is holding things back ('told you we should've used 
Java!').

Please bear with us, and do give us help for seemingly stupid questions 
when they come. I guess when people are overworked and frustrated, the 
simplest things do get overlooked.



Perrin Harkins wrote:

> jonathan vanasco wrote:
>
>> it sucks, completely.   i can't get my stuff to work under rc5 , and 
>> I'm way behind schedule on my work, so i can't help with porting 
>> modules to rc5 .  if you have spare time, you can  set up an rc5 
>> server and join in the patching fun.
>
>
> It would be nice if some of the users who were so vocal about 
> demanding this change a few months ago would help with the patching 
> fun, or at least help explain to people like Jonathan and Ji-Haw why 
> it needed to happen.
>
> - Perrin
>

Re: RC5 really broke some stuff

Posted by Perrin Harkins <pe...@elem.com>.
jonathan vanasco wrote:
> it sucks, completely.   i can't get my stuff to work under rc5 , and I'm 
> way behind schedule on my work, so i can't help with porting modules to 
> rc5 .  if you have spare time, you can  set up an rc5 server and join in 
> the patching fun.

It would be nice if some of the users who were so vocal about demanding 
this change a few months ago would help with the patching fun, or at 
least help explain to people like Jonathan and Ji-Haw why it needed to 
happen.

- Perrin

Re: RC5 really broke some stuff

Posted by Adam Kennedy <ad...@phase-n.com>.
Eeep... I missed it entirely. :)

Adam K

Philip M. Gollucci wrote:
> Adam Kennedy wrote:
> 
>> It sounds like the appropriate time for some enterprising young 
>> developer to grab a copy of PPI and write an mp2_rename tool, to do a 
>> first pass of what you describe below automatically.
> 
> 
>>>   http://people.apache.org/~geoff/fixme
> 
> Hi Adam, did you even look at this link.  He's already done it.
> 
> 
> 

Re: RC5 really broke some stuff

Posted by "Philip M. Gollucci" <pg...@p6m7g8.com>.
Adam Kennedy wrote:
> It sounds like the appropriate time for some enterprising young 
> developer to grab a copy of PPI and write an mp2_rename tool, to do a 
> first pass of what you describe below automatically.

>>   http://people.apache.org/~geoff/fixme
Hi Adam, did you even look at this link.  He's already done it.



-- 
END
------------------------------------------------------
Philip M. Gollucci (pgollucci@p6m7g8.com) 301.254.5198
Consultant / http://p6m7g8.net/Resume/resume.shtml
Senior Developer / Liquidity Services, Inc.
	http://www.liquidityservicesinc.com

Re: RC5 really broke some stuff

Posted by Adam Kennedy <ad...@phase-n.com>.
It sounds like the appropriate time for some enterprising young 
developer to grab a copy of PPI and write an mp2_rename tool, to do a 
first pass of what you describe below automatically.

Anyone?

Adam K

Geoffrey Young wrote:
>>it sucks, completely.   i can't get my stuff to work under rc5
> 
> 
> I feel for you, but I really don't understand this at all.
> 
> the changes required to move your codebase from rc4 to rc5 should be really,
> really minimal:
> 
>   - Apache2.pm doesn't exist any more, so remove it
>   - every Apache:: module now goes to Apache2::
>   - every constant goes from Apache:: to Apache2::Const
>   - Apache->request goes to Apache2::RequestUtil->request
>   - Apache->server goes to Apache2::ServerUtil->server
> 
> that should really be about it, and it's all documented at
> 
>   http://perl.apache.org/docs/2.0/rename.html
> 
> I created a script to help me port my CPAN modules over to RC5, which took
> less than 10 minutes each (including running the tests on 2.0 and 2.1).
> 
>   http://people.apache.org/~geoff/fixme
> 
> you'll need to adjust it for the mp2 modules you use, but it should get you
> really close.  (normal caveats apply - I'm not responsible if it nukes your
> codebase, make sure you look at the code to see what it's doing, etc :)
> 
> HTH
> 
> --Geoff

Re: RC5 really broke some stuff

Posted by Geoffrey Young <ge...@modperlcookbook.org>.
> it sucks, completely.   i can't get my stuff to work under rc5

I feel for you, but I really don't understand this at all.

the changes required to move your codebase from rc4 to rc5 should be really,
really minimal:

  - Apache2.pm doesn't exist any more, so remove it
  - every Apache:: module now goes to Apache2::
  - every constant goes from Apache:: to Apache2::Const
  - Apache->request goes to Apache2::RequestUtil->request
  - Apache->server goes to Apache2::ServerUtil->server

that should really be about it, and it's all documented at

  http://perl.apache.org/docs/2.0/rename.html

I created a script to help me port my CPAN modules over to RC5, which took
less than 10 minutes each (including running the tests on 2.0 and 2.1).

  http://people.apache.org/~geoff/fixme

you'll need to adjust it for the mp2 modules you use, but it should get you
really close.  (normal caveats apply - I'm not responsible if it nukes your
codebase, make sure you look at the code to see what it's doing, etc :)

HTH

--Geoff

Re: RC5 really broke some stuff

Posted by jonathan vanasco <jv...@mastersofbranding.com>.
On Apr 21, 2005, at 12:10 AM, Michael J Schout wrote:
> http://perl.apache.org/dist/
>

you will also need to use perl modules for mod_perl that were released 
before rc5 -- as many are in the process of being ported over.

the modules you use will be a mix of  current-version modules and their 
immediate predecessors.  fun, eh?

you installed mod_perl just as the API was being brought  up to date 
with the Apache2 api

it sucks, completely.   i can't get my stuff to work under rc5 , and 
I'm way behind schedule on my work, so i can't help with porting 
modules to rc5 .  if you have spare time, you can  set up an rc5 server 
and join in the patching fun.


Re: RC5 really broke some stuff

Posted by Michael J Schout <ms...@gkg.net>.
Foo Ji-Haw wrote:
> Where can one download pre-RC5 copies of mod_perl?

You can still get RC4 from

http://perl.apache.org/dist/

Regards,
Michael Schout

Re: RC5 really broke some stuff

Posted by Randy Kobes <ra...@theoryx5.uwinnipeg.ca>.
On Thu, 21 Apr 2005, Foo Ji-Haw wrote:

> Where can one download pre-RC5 copies of mod_perl? It's
> not on theoryx5 anymore.

There's an older ppm package at
  http://perl.apache.org/dist/win32-bin/ppms/
However, I'll be replacing that version soonish with RC5, as
these release candidates contain fixes and enhancements over
earlier distributions.

-- 
best regards,
randy

Re: RC5 really broke some stuff

Posted by Foo Ji-Haw <jh...@nexlabs.com>.
Where can one download pre-RC5 copies of mod_perl? It's not on theoryx5 
anymore.

jonathan vanasco wrote:

>
> Its pretty well documented everywhere -- including the  announcement 
> and install instructions
>
> libapreq does not work right yet.  if you're dealing with production 
> or stability sensitive stuff, i'd suggest keeping a copy of RC4 
> running and development on that release, then reading the migration 
> instructions to the new API once everything is sorted out.
>
> ================
>
>
> the mod_perl development team is pleased to announce the latest 
> version of
> mod_perl 2.0 - 2.0.0-RC5 - has been released.
>
> please note that this release contains substantial API changes, making it
> incompatible with all prior mod_perl 1.99 releases to date.  in other 
> words,
> you will need to modify ALL of your old 2.0 code before it will be 
> able to
> run with this latest release.  fortunately, the changes required are 
> minor,
> straightforward, and simple.
>
>
>   *** YOU WILL NEED TO MODIFY ALL YOUR CODE AFTER UPGRADING ***
>
>
> please take the time to read this document before continuing
>
>   http://perl.apache.org/docs/2.0/rename.html
>
> as it explains the changes, the reasons behind them, and the migration 
> path
> for your current codebase.
>
> now, for the details...
>
> The URL
>
>     http://perl.apache.org/dist/mod_perl-2.0.0-RC5.tar.gz
>
> has entered CPAN as
>
>   file: $CPAN/authors/id/G/GE/GEOFF/mod_perl-2.0.0-RC5.tar.gz
>   size: 1431194 bytes
>    md5: a523a60b5a9758a88a0f1bdcd09eb425
>
>
> Changes since RC4:
>
>     ******************** IMPORTANT ********************
>     this version of mod_perl is completely incompatible
>       with prior versions of mod_perl, both 1.XX and
>      1.99_XX. Please read the below changes carefully.
>     ***************************************************
>
>
>
> On Apr 20, 2005, at 10:22 PM, Foo Ji-Haw wrote:
>
>> It looks like the latest release of MP2 RC5 has been giving new 
>> installs code breaks.
>>
>> I don't know the full story, but I am pretty sure that the movers and 
>> shakers in the decision team have a strong point for it (possibly 
>> documented in perl.apache.org). It's caused me unexpected pain 
>> recently as well; and I have to spend today as well working through 
>> my codes because of it. But I am glad that people like Randy, Markus, 
>> and the documentation team (@perl.apache.org) have jumped in to help 
>> stranded people like me ('cos my job depends on my product!). Thanks 
>> guys!
>>
>> My only wish is that there will be no more changes to the libraries 
>> in such extent. After all, if this is the best way to move (mod_)perl 
>> forward, we must all bite the bullet at one time or another.
>>
>> But for those who cannot bite it now, perhaps there can be a way to 
>> download the pre-RC5 version?
>>
>> But no excuses for VB.NET!
>>
>

Re: RC5 really broke some stuff

Posted by jonathan vanasco <jv...@mastersofbranding.com>.
Its pretty well documented everywhere -- including the  announcement 
and install instructions

libapreq does not work right yet.  if you're dealing with production or 
stability sensitive stuff, i'd suggest keeping a copy of RC4 running 
and development on that release, then reading the migration 
instructions to the new API once everything is sorted out.

================


the mod_perl development team is pleased to announce the latest version 
of
mod_perl 2.0 - 2.0.0-RC5 - has been released.

please note that this release contains substantial API changes, making 
it
incompatible with all prior mod_perl 1.99 releases to date.  in other 
words,
you will need to modify ALL of your old 2.0 code before it will be able 
to
run with this latest release.  fortunately, the changes required are 
minor,
straightforward, and simple.


   *** YOU WILL NEED TO MODIFY ALL YOUR CODE AFTER UPGRADING ***


please take the time to read this document before continuing

   http://perl.apache.org/docs/2.0/rename.html

as it explains the changes, the reasons behind them, and the migration 
path
for your current codebase.

now, for the details...

The URL

     http://perl.apache.org/dist/mod_perl-2.0.0-RC5.tar.gz

has entered CPAN as

   file: $CPAN/authors/id/G/GE/GEOFF/mod_perl-2.0.0-RC5.tar.gz
   size: 1431194 bytes
    md5: a523a60b5a9758a88a0f1bdcd09eb425


Changes since RC4:

     ******************** IMPORTANT ********************
     this version of mod_perl is completely incompatible
       with prior versions of mod_perl, both 1.XX and
      1.99_XX. Please read the below changes carefully.
     ***************************************************



On Apr 20, 2005, at 10:22 PM, Foo Ji-Haw wrote:

> It looks like the latest release of MP2 RC5 has been giving new 
> installs code breaks.
>
> I don't know the full story, but I am pretty sure that the movers and 
> shakers in the decision team have a strong point for it (possibly 
> documented in perl.apache.org). It's caused me unexpected pain 
> recently as well; and I have to spend today as well working through my 
> codes because of it. But I am glad that people like Randy, Markus, and 
> the documentation team (@perl.apache.org) have jumped in to help 
> stranded people like me ('cos my job depends on my product!). Thanks 
> guys!
>
> My only wish is that there will be no more changes to the libraries in 
> such extent. After all, if this is the best way to move (mod_)perl 
> forward, we must all bite the bullet at one time or another.
>
> But for those who cannot bite it now, perhaps there can be a way to 
> download the pre-RC5 version?
>
> But no excuses for VB.NET!
>


RC5 really broke some stuff

Posted by Foo Ji-Haw <jh...@nexlabs.com>.
It looks like the latest release of MP2 RC5 has been giving new installs 
code breaks.

I don't know the full story, but I am pretty sure that the movers and 
shakers in the decision team have a strong point for it (possibly 
documented in perl.apache.org). It's caused me unexpected pain recently 
as well; and I have to spend today as well working through my codes 
because of it. But I am glad that people like Randy, Markus, and the 
documentation team (@perl.apache.org) have jumped in to help stranded 
people like me ('cos my job depends on my product!). Thanks guys!

My only wish is that there will be no more changes to the libraries in 
such extent. After all, if this is the best way to move (mod_)perl 
forward, we must all bite the bullet at one time or another.

But for those who cannot bite it now, perhaps there can be a way to 
download the pre-RC5 version?

But no excuses for VB.NET!


Re: [MP2] Import Apache with @ISA

Posted by Geoffrey Young <ge...@modperlcookbook.org>.

angie ahl wrote:
> Hi guys
> 
> I'm having a pickle with trying to importing Apache:
> 
> I'm following the example in the Mod Perl Cookbook (v1) and looked at
> the code samples from the book online.
> 
> httpd.conf has this:

that's all ok.

> package mymod::hook;
> 
> use strict;
> use warnings;
> 
> use Apache::Constants qw(:common);

um, there's no Apache::Constants in mp2 :)  I wouldn't suggest using
Apache2::compat with method handlers though, but for no good reason - I
don't know that it _doesn't_ work, only that it adds a layer of complexity
that may be clouding the issue.

> sub handler {

that needs to be

  sub handler : method {

> 	my $r = mymod::Apache->new(shift);
> 
> 	$r->content_type('text/html'); # do output of header
> 	
> 	print $r->uri;
> 	return Apache::OK;

Apache2::Const::OK with RC5

> #!/usr/bin/perl

that's an odd thing to have in a handler

> package mymod::Apache;
> 
> use Apache;

there's no Apache.pm in mp2

> 
> use DynaLoader;
> 
> use strict;
> 
> our @ISA = qw(DynaLoader Apache);

that should be Apache2::RequestRec

> 
> sub new {
> 
>   my ($class, $r) = @_;
> 
>   $r ||= Apache->request;

beware of that idiom in mp2 - it expect the request to be global, which
requires the proper httpd.conf switches.  just pass $r instead.

> 
>   return bless { r => $r }, $class;
> }
> 1;
> ________________________
> 
> 
> I get an error stating "Can't locate auto/mymod/Apache/content_typ.al in @INC"

since there's no Apache class in mp2 the autoloader can't find what it
needs. the mentioned adjustments should help.

> 
> Any idea what I'm missing? Is this another one of those things that's
> changed in MP2 ?

of course :)  but the underlying functionality is still there, and I'm sure
you can find stuff on method handlers in the perl.apache.org docs.

--Geoff