crontab has asked for the wisdom of the Perl Monks concerning the following question:
and a perl handler<html> <head> <title></title> </head> <body bgcolor="#FFFFFF"> <FORM ACTION="/cgi-bin/formtest.pl"> <P>Enter a URL to retrieve: <INPUT NAME="name"> <P><INPUT TYPE="SUBMIT" VALUE="GO!"> </FORM> </body> </html>
So, you enter a URL in the html page, and the perl retrieves it (well that's the idea).#!/usr/bin/perl -T use LWP::UserAgent; use CGI::Carp qw(fatalsToBrowser); use CGI qw(:standard); $url = param('name'); print header; print start_html('My Remote Webpage Request Service'); my $ua = LWP::UserAgent->new; my $res = $ua->get($url); print $res->content; print end_html;
If I enter a URL to a jpeg, the jpeg is displayed as garbage. An example line from what is returned to my browser is:
etc. What am I doing wrong? Thank you very much. JasongifGIF89anY1e!YMIEJ}c +Q<sE<)I; YJaRm9qޔ)QcyƵsƾ +
|
|---|