GET / HTTP/1.0 #### #! /usr/local/bin/perl -w use strict; use HTTP::Request; use LWP::UserAgent; $|++; my $URL = shift or die "no url on command line\n"; my $ua = new LWP::UserAgent; $ua->agent('Mozilla/4.7 [en] (Win95; I)'); my $r = new HTTP::Request; $r->header( Accept => [qw{image/gif image/x-xbitmap image/jpeg image/pjpeg image/png */*}], Accept_Charset => [qw{iso-8859-1 * utf-8}], Accept_Encoding => 'gzip', Accept_Language => 'en', Connection => 'Keep-Alive', ); $r->method( 'GET' ); $r->uri( $URL ); my $res = $ua->request( $r ); print $res->content; warn $res->code; #### #! /usr/local/bin/perl -w use strict; use CGI; my $q = new CGI; print $q->header(), $q->start_html( 'session echo' ), $q->h1( 'session echo' ), $q->table( $q->TR( { -valign=>'top' }, [map { $q->th( {-align=>'right'}, $_ ) . $q->td( $ENV{$_} ) } sort keys %ENV] ) ), $q->end_html();