Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

hi - i get a 501 error when i use HTTP::Header->referer(). Is there another way to control this http field? i m using ActiveState 5.8.6 on Win XP

Replies are listed 'Best First'.
Re: HTTP referer
by merlyn (Sage) on Jun 15, 2005 at 23:55 UTC
      yes. sorry. my $header = new HTTP::Headers( Date => scalar( gmtime ), Content_Type => 'text/html; version=4.1' ); $header->referer( "foo" ); gets me runtime error

        From the documentation, which merlyn was kind enough to point to:

        $h->header('Content-Type' => 'text/plain'); # set $ct = $h->header('Content-Type'); # get $h->remove_header('Content-Type'); # delete

        So, if you're trying to set the referrer to 'foo', you probably want the following:

        $header -> header( 'Referer' => 'foo' );
Re: HTTP referer
by Anonymous Monk on Jun 16, 2005 at 01:11 UTC
    Im an idiot. I found the problem... it wasnt the code, that code works great. stupid me is all.