Geoffrey Young wrote:

> But this patch simply ignores the 3 passed groups. Shouldn't it push > :common instead? > > my @args = grep { !/:response|:server|:args_how/ } @_; > push @args, ":common" if @_ != @args;

yeah, I thought about that afterward, since :response does include :common. but it wouldn't help on empty args, just on :response - :common isn't any use to the other two skipped tags.

so I'll do something with :common on :response and leave the others.

+1, but see below


 >
 > If someone used:
 >
 >   use Apache::Constants qw(:response);
 >
 > your patch won't make the code working, besides suppressing the import
 > error.
 >

indeed.

but I already mentioned that there are lots of other cases that would also break, such as using MOVED or SERVER_BUILT. and there's no easy way around it without simply aliasing _every_ constant in mp1 to its mp2 equivalent, forgoing entirely a simple pass of @_ to import().

so, I dunno. keeping the code simple and catching the most common cases, or doing a complete match and polluting the caller's namespace with constants they most likely won't need?

OK, can we easily tell what's supported and what not at run-time? If so, how about generating a user-friendly error message, explaining how to proceed? Or may be it won't make much sense, since it'll require the code to be modified.
FWIW, ModPerl::MethodLookup includes a hardcoded map of methods and groups of methods that were renamed or removed exactly for the porting purpose. How hard would it be to prepare such a transition map for the odd list of constants that you mention? Feel free to add a new method to ModPerl::MethodLookup to lookup constants.


__________________________________________________________________
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



Reply via email to