How to "Post" from Perl to Perl 
Author Message
 How to "Post" from Perl to Perl

I want to process information that has been "posted" from an HTML form,
and the pass it on to another script in exactly the same format (is if
it was posted directly to script 2).

How to I pass the output of script-1 to script-2?

--
Scott Holmes
NYD2/New York Digital Design

(908)534-6780



Tue, 11 Jan 2000 03:00:00 GMT  
 How to "Post" from Perl to Perl

[redirected to comp.infosystems.www.authoring.cgi]

Quote:

> I want to process information that has been "posted" from an HTML form,
> and the pass it on to another script in exactly the same format (is if
> it was posted directly to script 2).

use the LWP module and have one script make a POST request to the
other.  In the LWP module documentation you'll find this example
which does just what you ask:

=head2 An Example

This example shows how the user agent, a request and a response are
represented in actual perl code:

  # Create a user agent object
  use LWP::UserAgent;
  $ua = new LWP::UserAgent;
  $ua->agent("AgentName/0.1 " . $ua->agent);

  # Create a request
  my $req = new HTTP::Request POST => 'http://www.perl.com/cgi-bin/BugGlimpse';
  $req->content_type('application/x-www-form-urlencoded');
  $req->content('match=www&errors=0');

  # Pass request to the user agent and get a response back
  my $res = $ua->request($req);

  # Check the outcome of the response
  if ($res->is_success) {
      print $res->content;
  } else {
      print "Bad luck this time\n";
  }

=cut

good luck :)

--
brian d foy                              <URL:http://computerdog.com>                      



Tue, 11 Jan 2000 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. HELP getting "POST" to work

2. "…$_{$_} || exit for sort %_…" in post 5

3. "Malform Multipart Post"

4. "character class ""bug""

5. Looking for old post on "Hexagons"

6. system(("cp", "-Rf", "/tmp/a/*", "/tmp/b")); doesnt wrk

7. how to parse a "this", "that", "and the ", "other" file

8. "perlfreak", "i love perl", "perllover" or...???

9. Perl-Users Digest #552, "COPS in perl", newsgroup use

10. NT-Perl - No "#!/usr/bin/perl"

11. NT-Perl - No "#!/usr/bin/perl"

12. PERL problem: I get "objects/perl"

 

 
Powered by phpBB® Forum Software