Perl CGI Response codes other than 200 OK

Ian Burrell ianburrell at gmail.com
Mon Mar 13 22:02:22 UTC 2006


Don Russell <fedora <at> drussell.dnsalias.com> writes:
> 
> I've spent most of yesterday trying to solve this by searching google... 
> 
> I'm trying to use HTTP::Response to create a response when my perl cgi
> program is run.
> 

Why are you using HTTP::Response?  That is the class for representing responses
from the server in LWP, the HTTP client module.  It is not for generating
responses on the server-side.

If you are using CGI, then use the header() method.  It takes a -status option.

If you are using mod_perl, it is $r->status().  Apache2::Const for mod_perl2
contains constants for the different statuses like OK.

 - Ian





More information about the fedora-list mailing list