Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Submitted URL turned into source code sent to CGI?

Status
Not open for further replies.

mpalmer12345

Programmer
Feb 16, 2004
59
US
I want to write an HTML program that accepts user input via a form submission in the form of a website URL link (such as then sends the HTML source code of the inputted URL to a CGI file for processing. How would I do this? Any tips or hints would be much appreciated, as I am nearly a beginner at this.
 
You can accomplish this using LWP::Simple and the CGI.pm
Code:
#!/usr/bin/perl

use strict;

use LWP::Simple;

use CGI;
my $q = new CGI;

my $url = $q->param('url');
my $content = get($url);               

# Do something with $content
print $content;

M. Brooks
X Concepts LLC
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top