#!/usr/bin/perl

# This one is the goal:
#
#<form method="POST" action="http://www.webster.com/cgi-bin/dictionary">
#   <input type="hidden" name="book" value="Dictionary"/>
#   <input name="va" size="35"/>
#   <input type="submit" value="Dictionary"/>                                     
#</form>
############################################################
#  Lets start off with something simple
#<form border=0 method=get action="http://search.yahoo.com/bin/search" >
#  <input size=9 name=p>
#  <input type=submit value="yahoo&#33;" >
#</form>
#
#<form border=0 method=get action="http://google.com/search"  >
#  <input maxLength=256 size=9 name=q value="">
#  <input type=submit value="google&#33;" >
#</form>

use HTTP::Request::Common qw(POST);
use LWP::UserAgent;

$ua = LWP::UserAgent->new();
my $req = POST 'http://google.com/search',[ q=>cats ] ;
$content=$ua->request($req)->as_string;

print "$content\n";


# http://www.perldoc.com/perl5.8.0/lib/HTTP/Request/Common.html	

# The GET() function returns a HTTP::Request object initialized with 
#   the GET method and the specified URL. Without additional arguments 
#   it is exactly equivalent to the following call.



use HTTP::Request::Common;
$ua = LWP::UserAgent->new;
$ua->request(GET 'http://www.sn.no/');
$ua->request(POST 'http://somewhere/foo', [foo => bar, bar => foo]); 
$res = $ua->request($req);
print $res->content;

