in reply to Content Length

If this is all of the code you're using, it shouldn't come as a suprise that no useful information is returned. You never request any information, you just try to read some environment variables of the local machine the script happens to be running on.

Maybe it would help if you'd clearly state what you'd like to obtain since I have the impression you're mixing up CGI with user agent functionality.

Are you trying to obtain the number of characters of a web page that is specified by an URL?

Regards, -gjb-

Replies are listed 'Best First'.
Re: Re: Content Length
by Anonymous Monk on Nov 11, 2002 at 14:32 UTC
    I'm trying to obtain the content length in bytes or lines for google.com, or any other site specified
      Take a look at LWP, along with the associated HTTP::Request, HTTP::Response, and HTTP::Headers object
      use LWP; use HTTP::Request; my $ua = LWP::UserAgent->new(); my $request = HTTP::Request->new( GET => 'http://www.google.com' ); my $response = $ua->request( $request ); my $headers = $response->headers(); print $headers->header( 'Content-Length');