package Apache::HttpEquiv;
# file: Apache/HttpEquiv.pm
use strict;
use Apache::Constants qw(:common);

sub handler {
    my $r = shift;
    local(*FILE);

    return DECLINED if # don't scan the file if..
        !$r->is_main # a subrequest
            || $r->content_type ne "text/html" # it isn't HTML
                || !open(FILE, $r->filename); # we can't open it

    while(<FILE>) {
        last if m!<BODY>|</HEAD>!i; # exit early if in BODY
        if (m/META HTTP-EQUIV="([^"]+)"\s+CONTENT="([^"]+)"/i) {
            $r->header_out($1 => $2);
        }
						}
    close(FILE);
    return OK;
}             

1;
__END__
