Reading html into a source file

C

Chris

Apologies for the mail but this is driving me crazy. I'm trying to
read an external html file into an array and then check for a sub
string in the array. The only problem is that the html file is not
getting loaded into either the array or a text file. I have tried the
following:

#!/usr/local/bin/perl
print "Content-Type: text/plain\n\n";
use LWP::Simple;
$content = get ("http://www.webbuyeruk.co.uk/index.htm");
print " This is Content:\n\n $content \n\n";
exit;

(above as seen in google postings) but no contents appear on my
screen? Any help appreciated! I'm using perl 5.8 on windows 2K.

Regards,

Chris.
 
D

David K. Wall

Apologies for the mail but this is driving me crazy. I'm trying to
read an external html file into an array and then check for a sub
string in the array. The only problem is that the html file is not
getting loaded into either the array or a text file. I have tried the
following:

#!/usr/local/bin/perl

If you're running this as CGI under Apache this might be a problem. Apache
actually uses the #! line. perl.exe will process any switches on the #!
line but will otherwise ignore it IIRC.
print "Content-Type: text/plain\n\n";
use LWP::Simple;
$content = get ("http://www.webbuyeruk.co.uk/index.htm");
print " This is Content:\n\n $content \n\n";
exit;

(above as seen in google postings) but no contents appear on my
screen? Any help appreciated! I'm using perl 5.8 on windows 2K.

Runs fine for me at the command line under Windows XP Pro. It's not your
program, so it must be something with your web server, i.e; not a Perl
problem.
 
B

Bill

#!/usr/local/bin/perl
print "Content-Type: text/plain\n\n";
use LWP::Simple;
$content = get ("http://www.webbuyeruk.co.uk/index.htm");
print " This is Content:\n\n $content \n\n";
exit;

(above as seen in google postings) but no contents appear on my
screen? Any help appreciated! I'm using perl 5.8 on windows 2K.

Works here, 5.8, XP. are you running it via

c:> perl filename.pl

or as

c:> filename.pl

or by clickin on filename? If the latter two, you need
/usr/local/bin/perl.exe to exist, of course :/
 
G

Gregory Toomey

David said:
If you're running this as CGI under Apache this might be a problem.

I dont think he even realises he needs a web server to run it.

gtoomey
 
M

Matt Garrish

Bill said:
(e-mail address removed) (Chris) wrote in message

Works here, 5.8, XP. are you running it via

c:> perl filename.pl

or as

c:> filename.pl

or by clickin on filename? If the latter two, you need
/usr/local/bin/perl.exe to exist, of course :/

Why do you say that? Windows will check the registry in the latter two cases
to determine the default application to use to run .pl files. All he needs
is a correct file association.

Matt
 
C

Chris

Thanks for the comments to my posting (not mail),

Will try your comments tonight Bill and post a follow up tomorrow, I'm
not running through a web server as I have downloaded perl 6.0 and am
running in DOS whilst having a permanent TCP/IP connection, the result
may be different when I run it from home as I was running it at work
behind a firewall.

Thanks for the input so far.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top