* Arnold van Kampen <[EMAIL PROTECTED]> [2002-06-13 09:34]:
> Why do I have have so much trouble doing some header parsing? I am
> doing header parsing because I wanted to check out cookie behaviour
> on relocation/redirection by browser. I get stuck when I cannot get
> with the basic stuff. Clues appreciated..
Why not use Apache::Cookie, or even CGI's cookie() function, to parse
cookies?
> use strict;
> use Apache::Constants;
> use Apache::Reload;
> use CGI qw(:standard :html3 :netscape);
> use Apache::Table;
>
> sub handler {
> my $r = shift;
> my $reason = $r->subprocess_env("AuthCookieReason");
> my $cookie = $r->header_in('Cookie');
> my $table = $r->headers_in;
> my $bla ="sdadsadadadasdadadadadadaaaaaaaaaaaaaaaaaaaaaaaa";
> my $type = $table->{'Content-type'};
>
> print header,start_html,
> h2($bla),
> h2($type),
> end_html;
>
> }
You can iterate over the keys of %$table, to see what's being set.
Change your print statement to something like:
print header,start_html,
h2($bla),
h2($type),
ul(map(li($_, " => ", $table->{$_}), keys %{$table})),
end_html;
To get a list of the keys in $r->headers_in;
Also, you forgot to return OK.
(darren)
--
Responsible behavior is the result of a socialization process.