meng has asked for the wisdom of the Perl Monks concerning the following question:
Hi, I will try to write a small program which
1) get a webpage from a url
2) check some patterns or do sth.
3) display the result to user via browser.
However, I had problems dealing with the display of feedback. So I tested this small code:
Anything wrong? or my idea is wrong
Can anyone help me? Thank you<
1) get a webpage from a url
2) check some patterns or do sth.
3) display the result to user via browser.
However, I had problems dealing with the display of feedback. So I tested this small code:
It does work if I run it in the console using "perl test.pl", but it is not working as a cgi program, basically I cannot display anything in the browser, even it is just a "hello" here.#-------------------------------- #! /usr/bin/perl -w use CGI; use LWP::Simple; print "Content-type: text/html\n\n"; $url = "http://www.yahoo.com"; my $webpage = get($url); print $webpage; print<<_HTMLEND; <HTML> <BODY> <H1> hello </H1> </BODY> </HTML> _HTMLEND #-----------------------------------------
Anything wrong? or my idea is wrong
Can anyone help me? Thank you<
Edit by castaway - Added code tags
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: about use LWP::Simple
by chromatic (Archbishop) on Feb 13, 2005 at 07:59 UTC | |
Re: about use LWP::Simple
by holli (Abbot) on Feb 13, 2005 at 08:55 UTC | |
Re: about use LWP::Simple
by johnnywang (Priest) on Feb 13, 2005 at 08:18 UTC | |
by Anonymous Monk on Feb 13, 2005 at 19:05 UTC | |
Re: about use LWP::Simple
by dws (Chancellor) on Feb 13, 2005 at 18:37 UTC | |
Re: about use LWP::Simple
by geektron (Curate) on Feb 13, 2005 at 17:05 UTC | |
Re: about use LWP::Simple
by Paulster2 (Priest) on Feb 14, 2005 at 01:03 UTC |
Back to
Seekers of Perl Wisdom