Solved

Automatically submitting a form in Perl

Posted on 2004-03-21
1
182 Views
Last Modified: 2013-12-25

I have a perl script that I am using to send an automated email when members register for our site.  I would like to add a function that sends a form of variables to a URL.  What would be the best way to do this?

Thanks in advance
-47
0
Comment
Question by:Agent47
1 Comment
 
LVL 48

Accepted Solution

by:
Tintin earned 50 total points
ID: 10646532
use LWP::UserAgent;
$ua = LWP::UserAgent->new;  

my $req = HTTP::Request->new(POST => 'http://www.perl.com/cgi-bin/BugGlimpse');

$req->content_type('application/x-www-form-urlencoded');
$req->content('match=www&errors=0');  

my $res = $ua->request($req);
print $res->as_string;
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Recently I have been answering a lot of questions like this in IT forums that I frequent. The question posed is usually something along the lines of "We have software X installed and need to uninstall it for reason Y" or some other variant of the sa…
Batch, VBS, and scripts in general are incredibly useful for repetitive tasks.  Some tasks can take a while to complete and it can be annoying to check back only to discover that your script finished 5 minutes ago.  Some scripts may complete nearly …
Learn the basics of strings in Python: declaration, operations, indices, and slicing. Strings are declared with quotations; for example: s = "string": Strings are immutable.: Strings may be concatenated or multiplied using the addition and multiplic…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question