LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices



Reply
 
Search this Thread
Old 02-06-2006, 05:07 PM   #1
SparceMatrix
Member
 
Registered: Aug 2002
Distribution: SME Server, CentOS
Posts: 219

Rep: Reputation: 30
PERL: Can you open an HTML file from a web address?


I am brand new to PERL and I'm trying to figure out if I can open an HTML file for parsing from a web address. It seems to me that I have heard the file argument in open(HANDLE, $FilePath) called a URL. But, I can't seem to put a URL in there, as in "open(FH,'HTTP://www.MySite.com/index.html')" Maybe I am adding it wrong or something. If it is possible, documentation does not seem to reflect it.

Any ideas, anyone?
 
Old 02-06-2006, 05:20 PM   #2
Spudley
Member
 
Registered: Mar 2003
Location: Berkshire, England.
Distribution: SuSE 10.0
Posts: 299

Rep: Reputation: 32
My Perl is a bit rusty, but if I was doing this, my first approach would be to look up the CURL library. I've been using it recently in other languages for exactly the same purpose, and I know it's available for Perl, so I'd say it's exactly what you're looking for.

Google gave me these results:
http://search.cpan.org/~crisb/WWW-Curl-2.0/
http://curl.netmirror.org/libcurl/perl/
http://www.dagblastit.com/https_post...ttps_post.html

Sorry I can't help you with more precise code examples, but I hope I've been of some help
 
Old 02-06-2006, 06:57 PM   #3
bpalmer
Member
 
Registered: Mar 2005
Distribution: Debian stable, OpenBSD, FreeBSD
Posts: 30

Rep: Reputation: 15
Probably not what you're looking for, but you could always use wget:

chdir(/path/where/you/want/it/saved);
`wget site.com/whatever.html`;

Then read it in and do what you like.

Not sure how complicated you need it, but that may suffice for the time being.

Good luck.
 
Old 02-07-2006, 12:06 PM   #4
SparceMatrix
Member
 
Registered: Aug 2002
Distribution: SME Server, CentOS
Posts: 219

Original Poster
Rep: Reputation: 30
cURL looks like my best bet and even better, a complete script is available that looks like it does what I want to do: Leech. And cURL is required to be installed to make this thing work.

I did want something to work on my XP-Pro. Oh well.

Thanks, all who replied.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Open HTML file in default browser through C++ Last Attacker Linux - General 10 10-20-2005 01:32 PM
Apache-HTML can't open dir on web site comprookie2000 Linux - Networking 4 03-07-2005 03:40 PM
cgi perl : I cant get perl to append my html file... the_y_man Programming 3 03-22-2004 06:07 AM
perl(Cwd) perl(File::Basename) perl(File::Copy) perl(strict)....What are those? Baldorg Linux - Software 1 11-09-2003 09:09 PM
Perl Script Reading a txt file and generate html to be published! kofi Linux - Software 1 09-22-2003 06:12 PM


All times are GMT -5. The time now is 05:13 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration