Stas Bekman wrote:
> Any objects to this new util function? 

not really.  but...

> If you follow the discussion on
> p5p, we have no way but to provide our own function for multiple
> reasons. Besides, it's does exactly what most mp2 module authors will
> want, i.e.:
> 
> if (ModPerl::Util::parse_version("Apache::Request") > 2 &&
>     eval { require Apache::Request }) {
>     # use Apache::Request
> }
> else {
>     # use something else
> }
> 
> you don't need to check for defined, nor to force numerical context for
> cases like '2.03-dev'. it gives you a good number to use.
> 
> notice that 'use Apache::Request 2.0' doesn't work, because it may load
> an old mp1 version which is not binary compatible. 

I think that a simple 'use' will suffice for the vast majority of users.  if
 you try to 'use Apache::Request 2.0;' and you get the wrong version then
something is wrong with your application setup - you've forgotten to load
Apache2.pm or somesuch.  most people will indeed want it to fail, so
requiring a the module and having it die when compared to the required
version is DWIMmy.

> and as it's in case
> of Apache::Status, we don't want to die if Apache::Request version
> wasn't satisfied, and CGI.pm is available.

yes, I see that.  but it's probably a very rare case, substituting one
module for another - you generally can't just do that in production code (at
least you can't if you really value "production").  so, outside of
substituting one module for another, I don't see this function being all
that useful.

> 
> Unless you have better ideas, I'll go ahead and commit this new function
> and use it in Apache::Status which is currently somewhat broken because
> of that.

p5p seemed to be interested in adding the functionality to version.pm or
somesuch, so maybe wait and see how it plays out there before we end up
maintaining our own version?

--Geoff


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

Reply via email to