http://qs1969.pair.com?node_id=426681

It isn't readily apparent from the docs how to get at the HTTP headers while using WWW::Mechanize. The miscellaneous add_header and delete_header likely don't do what you want. The following snippet gets you a complete list of headers and their values as well as shows you how to get a specific value if you know the header key in advance.
#!/usr/bin/perl use strict; use warnings; use WWW::Mechanize; my $mech = WWW::Mechanize->new( autocheck => 1 ); $mech->get( 'http://www.perlmonks.org/' ); my $response = $mech->response(); for my $key ( $response->header_field_names() ) { print $key, " : ", $response->header( $key ), "\n"; } # Or if you know the header key in advance my $header = $mech->response()->header( 'key' );