Per Einar Ellefsen wrote:

> 
> Hi,
> 
> After some discussion on the mod_perl list with Perrin Harkins, it 
> seemed to me like it would be goot having a warning about problems with 
> using constant subroutines (in hash constructs, where barewords get 
> stringified, etc).

the warning looks good.  I'd only take exception to the following:

Therefore, you can avoid this by either not using the has notation
C<=E<gt>>, or by doing steps like this:

   $r->custom_response(FORBIDDEN() => "File size exceeds quota.");
   $r->custom_response(+FORBIDDEN => "File size exceeds quota.");


probably the best and most simple solution is the one I gave to Isaac, 
which is the one from the Apache.pm documentation for custom_response():

$r->custom_response(AUTH_REQUIRED, "/error.html");

personally, I think that FORBIDDEN() is just as bad as $FORBIDDEN - it's 
removing the constant idea behind constant subroutines (though sometimes 
you just have to do things that way to get past the compiler or 
whatnot). it's a matter of personal choice, I suppose...

oh, and C<OK == 1> is wrong - OK is 0 (which is another reason to just 
use constants and forget about their values ;)

--Geoff


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

Reply via email to