shadedecho
Programmer
I have a perl file i'm running from an apache request as a cgi file (mod_perl).
Inside this file, I want to use the Apache2::Response module and be able to call methods on an object instance. Essentially, I want to be able to conditionally decide to send certain HTTP response codes (like 204 or 404).
I tried something like:
The perl interpreter of course chokes on the "new ..." line. All the documentation and code samples I can find just show use of $r that seems to just magically be already created for use. But how do I create one to use?
Inside this file, I want to use the Apache2::Response module and be able to call methods on an object instance. Essentially, I want to be able to conditionally decide to send certain HTTP response codes (like 204 or 404).
I tried something like:
Code:
use Apache2::Response;
$r = new Apache2::Response();
$r->status_line("204 No Content");
exit;
The perl interpreter of course chokes on the "new ..." line. All the documentation and code samples I can find just show use of $r that seems to just magically be already created for use. But how do I create one to use?