First you should always use strict. It'll help catch things like your misspeling
of jonh. The request you are sending is for a POST, which means that the
form data has to be passed in the body of the request, which you forgot to do.
So just add:
$req->content($john);
Correct the spelling mistake, use strict, my all your variables, and it should
work fine.. except that your query isn't understood by their cgi.
I used this query for testing:
my $john =
qq|order=symbol&include=selected&*limit=500&_Species_key=1&op%3Asymname=begins&symname=&symnameBreadth=CWS&op%3Achromosome=%3D&chromosome=&op%3AcytogeneticOffset=begins&cytogeneticOffset=&op%3A_primary=begins&_primary=&refid=&id=&cmp_Species_key=&op%3Acmp_chromosome=%3D&cmp_chromosome=&op%3Acmp_cytogeneticOffset=begins&cmp_cytogeneticOffset=|;
p.s. interesting project :)
--
my edited version:
use strict;
use LWP::UserAgent;
my $ua = LWP::UserAgent->new;
my $req = HTTP::Request->new(POST =>
'http://www.informatics.jax.org/searches/homology_report.cgi');
$req->content_type("application/x-www-form-urlencoded");
my $john =
qq|order=symbol&include=selected&*limit=500&_Species_key=1&op%3Asymname=begins&symname=&symnameBreadth=CWS&op%3Achromosome=%3D&chromosome=&op%3AcytogeneticOffset=begins&cytogeneticOffset=&op%3A_primary=begins&_primary=&refid=&id=&cmp_Species_key=&op%3Acmp_chromosome=%3D&cmp_chromosome=&op%3Acmp_cytogeneticOffset=begins&cmp_cytogeneticOffset=|;
$req->content($john);
# print $req->as_string();
my $res = $ua->request($req);
print $res->code,'\n';
print $res->content();
Greg Touchton wrote:
> I can't get any response from the location I am trying to contact. I can reach
> an external location like www.yahoo.com without any problem. When I use my web
> browser I have no problem receiving a response from the CGI even if I give bad
> information to the POST. I know I am not using a proxy. Please pardon my email
> program for the wordwrap...
>
> use LWP::UserAgent;
> $ua = LWP::UserAgent->new;
> my $req = HTTP::Request->new(POST =>
> 'http://www.informatics.jax.org/searches/homology_report.cgi');
> $req->content_type("application/x-www-form-urlencoded");
> $john =
> qw(order=symbol&include=""&*limit=0&_Species_key=""&op:symname=begins&);
> $john .= qw(symname=abl1);
> $jonh.=qw(&symnameBreadth=CWS&cmp_Species_key="");
> my $res = $ua->request($req);
> print $res->code,'\n';
>
> Thank you,
>
> Greg Touchton \\ /=====|
> 540-552-5967 \\ // =|
> 338 Shenandoah Cir \// =|
--
Perl, because 600 billion oysters can't be wrong
Canadian Consulting Services' pet perl hacker
David Labatte [EMAIL PROTECTED]