Building an Array

2004-10-13 Thread Thomas Drought
Real Perl newbie question...

I have a script that retrieves a response using HTTP:Request and
HTTP:Response. I get back a response in the content as a URLEncoded string.
For example 'id=101&results=passed'

I would like to take this response, and parse it into an array where I can
call each value by it's key name, for example:

print 'My ID = %myarray['id']';
print 'My Results = %myarray['results']';


How can I do this?

Thanks,
Tom


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




Help creating a simple local gateway for testing HTTP::Request

2004-10-12 Thread Thomas Drought
Hello all,

I was wondering if someone could help me. I have a script which send an
HTTP::Request

I would like to be able to view what it is sending. I thought I could just
create use HTTP::Daemon for this, but I'm not getting any response from it.
I want to see the information from the initial request with headers.

Here is what I have...

Request:

  $req = HTTP::Request->new(POST =>
'http://localhost:83/cgi-bin/server.cgi' );

And Daemon:

#!/usr/bin/perl

use vars qw( $req $d $c );
  ( $req, $d, $c ) = ();


use strict;
use HTTP::Daemon;

$d = HTTP::Daemon->new;
while ( $c = $d->accept ) {
 $req = $c->get_request;
 printf $req
 }
$c = undef;   # don't forget to close the socket


Thanks,
Tom


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