Perl CGI setting headers
#!/usr/bin/perl -wT
use strict;
use warnings;
use CGI qw(:standard);
print header('text/plain', '404 Not Found');
print "Move along, nothing to see here\n";
At promp, execute: curl -i url-to-script
which returns:
HTTP/1.1 404 Not Found
Date: Fri, 04 Oct 2013 14:14:58 GMT
Server: Apache
Vary: Accept-Encoding
Transfer-Encoding: chunked
Content-Type: text/plain; charset=ISO-8859-1
Move along, nothing to see here
From JR's : articles
59 words - 454 chars
created on
- #
source
- versions
Related articles
Perl programming tools to test - Nov 14, 2014
Looping through Perl data types - Nov 25, 2013
Perl and OAuth - Dec 03, 2013
Perl Dancer Framework - Dec 19, 2013
Interview with Mojo Mail author - November 2002 - Jul 18, 2014
more >>