I just found out (via Stas) that more recent perl's have gotten a bit more DWIMmy.
a common mod_perl error used to look like this:
$r->custom_response(SERVER_ERROR => 'yikes');
=>
makes the SERVER_ERROR
constant (500
) into the string "SERVER_ERROR
". so, you needed to use a comma instead, making the code look like this:$r->custom_response(SERVER_ERROR, 'yikes');
=>
operator and still get your constant, so$r->custom_response(Apache::SERVER_ERROR => 'yikes');
Apache::
namespace (as mod_perl 2.0 will let you) this$r->custom_response(SERVER_ERROR => 'yikes');
package My; use constant FOO => 0; # My::FOO package main; use constant FOO => 1; # main::FOO args(FOO => 'arrow'); args(FOO, 'comma'); args(main::FOO => 'arrow'); args(main::FOO, 'comma'); args(My::FOO => 'arrow'); args(My::FOO, 'comma'); sub args { print join ':', @_, "\n"; }
However, you can make the arrow operator stuff work by calling SERVER_ERROR as SERVER_ERROR().