10.07.2015 Views

Beginning Web Development With Perl : From Novice to ... - Nabo

Beginning Web Development With Perl : From Novice to ... - Nabo

Beginning Web Development With Perl : From Novice to ... - Nabo

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

218CHAPTER 11 ■ DEVELOPMENT WITH MOD_PERLEach of the class methods of Apache::Table has its own set of methods, including the following:• add()• clear()• do()• get()• merge()• new()• set()• unset()Since name=value pairs are sent from the headers_in() method, the output naturally lendsitself <strong>to</strong> being represented in a hash. Listing 11-9 (Headersin.cgi) prints the output from theheaders_in() method.Listing 11-9. The headers_in() Method <strong>to</strong> See Name=Value Pairsuse strict;my $r = shift;$r->send_http_header('text/plain');my %headers = $r->headers_in();foreach my $header (keys %headers) {print "$header = $headers{$header}\n";}The output is shown in Figure 11-13.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!