Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

howto: access or manually create Apache2::Response object?

Status
Not open for further replies.

shadedecho

Programmer
Oct 4, 2002
336
0
0
US
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:

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?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top