At 14:28 24.04.2002, Geoffrey Young 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...

Yes, I agree. I just seem to remember that that was what is suggested in 
the perl docs. Anyway, there is no reason to use hash notation here. 
However, there might be for some other functions (don't ask me which).

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

Thanks for spotting that one :) I still think that warning is important 
though, as I've seen that a couple of times on the list.


-- 
Per Einar Ellefsen
[EMAIL PROTECTED]



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

Reply via email to