CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Intermediate:
Reading HTML from external web pages

 



evilL2
Novice

Aug 8, 2003, 6:10 AM

Post #1 of 11 (974 views)
Reading HTML from external web pages Can't Post

Is there any way to reach ,recieve and print HTML content placed on other server???


KevinR
Veteran


Aug 8, 2003, 4:25 PM

Post #2 of 11 (971 views)
Re: [evilL2] Reading HTML from external web pages [In reply to] Can't Post

here is a simple example:

#!/perl/bin/perl.exe

print "Content-type: text/html\n\n";
use strict;
use LWP::Simple;
my $content = get(
http://url_of_file);
print $content;

-------------------------------------------------


evilL2
Novice

Aug 9, 2003, 8:36 AM

Post #3 of 11 (965 views)
Re: [KevinR] Reading HTML from external web pages [In reply to] Can't Post

Thanks, but my server tells me that there is an error in the line: "use strict".

It tells me:

"Can't locate strict.pm in @INC (@INC contains: . /lib /site_perl) at read.pl line 4.
BEGIN failed--compilation aborted at read.pl line 4."


What is wrong???


KevinR
Veteran


Aug 9, 2003, 10:17 AM

Post #4 of 11 (964 views)
Re: [evilL2] Reading HTML from external web pages [In reply to] Can't Post

that seems strange.... try it without strict:

#!/perl/bin/perl.exe

print "Content-type: text/html\n\n";
use LWP::Simple;
$content = get(
http://url_of_file);
print $content;


-------------------------------------------------


Jane
Novice

Aug 9, 2003, 2:38 PM

Post #5 of 11 (959 views)
Re: [evilL2] Reading HTML from external web pages [In reply to] Can't Post

The code works when the argument to get() is quoted


Code
   

my $content = get('http://url_of_file');



This may help with your @INC problem.

http://perlguru.com/gforum.cgi?post=17330;search_string=%40INC;#17330

Jane.
Think |negatively :(|
map{$,--%(5>>1)^0?push@y,$_:unshift@y,$_}sort(Hacker=>another=>Perl=>Just);for(1&1=>1|0){push@y,shift@y}print"@y";


KevinR
Veteran


Aug 9, 2003, 4:08 PM

Post #6 of 11 (957 views)
Re: [Jane] Reading HTML from external web pages [In reply to] Can't Post

Blush oops, my bad, yes the argument needs to be quoted, thanks!
-------------------------------------------------


davorg
Thaumaturge / Moderator

Aug 11, 2003, 1:39 AM

Post #7 of 11 (952 views)
Re: [evilL2] Reading HTML from external web pages [In reply to] Can't Post


In Reply To
Thanks, but my server tells me that there is an error in the line: "use strict".

It tells me:

"Can't locate strict.pm in @INC (@INC contains: . /lib /site_perl) at read.pl line 4.
BEGIN failed--compilation aborted at read.pl line 4."

What is wrong???


Sounds like you have a rather broken (or, perhaps, very old) Perl installation. You might like to try reinstalling it from scratch.

--
Dave Cross, Perl Hacker, Trainer and Writer
http://www.dave.org.uk/
Get more help at Perl Monks


evilL2
Novice

Aug 11, 2003, 9:32 AM

Post #8 of 11 (948 views)
Re: [davorg] Reading HTML from external web pages [In reply to] Can't Post

The problem is that I can't reinstall perl...

I'm working with "Tripod", and it seems that it does not support models at all...

Is there a way activating modules like "strict" in Tripod?

PiratePiratePirate


KevinR
Veteran


Aug 11, 2003, 11:01 AM

Post #9 of 11 (947 views)
Re: [evilL2] Reading HTML from external web pages [In reply to] Can't Post

No there is not, tripod (free accounts) has a very crippled version of perl they let their members use. If you really want to do perl stuff you need to find a better host, I am sure there are free ones that allow nearly unrestricted use of perl, you just need to hunt around.
-------------------------------------------------


evilL2
Novice

Aug 15, 2003, 8:56 AM

Post #10 of 11 (940 views)
Re: [KevinR] Reading HTML from external web pages [In reply to] Can't Post

Could you recommend me one???

(free cgi host that support basic modules)

Crazy


KevinR
Veteran


Aug 15, 2003, 11:51 AM

Post #11 of 11 (938 views)
Re: [evilL2] Reading HTML from external web pages [In reply to] Can't Post

sorry, I don't have a list of free servers that support perl, you will have to dig out the old search engine and start looking. One that does come to mind is www.virtualave.com but I have no idea how their service is these days, I used them years ago for messing around with scripts.
-------------------------------------------------

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives