Hi Everyone

I'm having a spot of bother with a query string.

The program below attempts to mimic a web form. It should post the value of
'QUERY ..' to the cgi in $location.

What is actually happening is that 'QUERY ..' itself is being sent as the
value. I copied the name 'QUERY ..' from the textarea name on the original
web form.

I have tried character escaping the space and the two dots but that didn't
work (the cgi hung). 
Maybe I need to use CGI.pm to generate the query string?
Anyone got any ideas?
Thanks
James

----------------------

#!/usr/bin/perl -w
use strict;
use LWP::UserAgent;
use HTTP::Request;

#This is the sequence for analysis (it is actually all on one line!!!)
my Seq='MQMRVLRIQHPLDHRPRHDRKTRHEVMLPDRKTRDLVVAIRNDRRA
      LRIGAHIQAMPVFRRVQIERRRGVRRMHVADALLNQLRGLRMQFQRHAERGRR
      ALTRVVVRRGADAARGEHDVSRGERAPQRRRDALGVVADVLRPAERQPTRAEQ
      FDNLRQMLVDPPARQDLIADDDDAKCHCRLFRLVSNSSVGNRRRVPHAAVLFR
      AHALQRAQTV';

#Send the request
my $location = "http://www.sbc.su.se/~miklos/DAS/tmdas.cgi";;
my $agent = new LWP::UserAgent;
my $req = new HTTP::Request POST => "$location";
      $req -> header('Accept' => 'text/html');
      $req -> header('Accept' => 'image/gif');
      $req -> header('Accept' => 'text/plain');
      $req -> header('Content-Type' => 'application/x-www-form-urlencoded');
      $req -> content('QUERY ..' => $seq);


#Receive the response
my $result = $agent->request( $req );
       print $result->headers_as_string;
       print $result->content;





James Campbell
Tel:    +44-(0)207-848-5111
Email: [EMAIL PROTECTED]
 =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=  

'Where shall I begin, please your Majesty?' He asked
'Begin at the beggining,' the King said gravely, 'and go on 
till you come to the end: then stop.'

Lewis Carroll, Alice's Adventures in Wonderland.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to