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: Beginner:
Open file

 



jumaru
Deleted

Feb 24, 2000, 4:59 AM

Post #1 of 7 (1033 views)
Open file Can't Post

Hi everybody
I know how to open a file but I don't know how to open a file which is on another server



japhy
Enthusiast

Feb 24, 2000, 5:41 AM

Post #2 of 7 (1033 views)
Re: Open file [In reply to] Can't Post

If you mean "how do I read a file from off the internet?" then the easiest method is:

<BLOCKQUOTE><font size="1" face="Arial,Helvetica,sans serif">code:</font><HR>


use LWP::Simple;
$content = get $URL;
</pre><HR></BLOCKQUOTE>

The LWP bundle can be downloaded from http://search.cpan.org/


jumaru
Deleted

Feb 25, 2000, 2:48 AM

Post #3 of 7 (1033 views)
Re: Open file [In reply to] Can't Post

thanks a lot but I didn't know how to download it and I found a documentation not the file Frown
please more detail and more help


japhy
Enthusiast

Feb 25, 2000, 5:45 AM

Post #4 of 7 (1033 views)
Re: Open file [In reply to] Can't Post

 http://search.cpan.org/search?dist=libwww-perl is the main location for the libwww-perl bundle. http://www.perl.com/CPAN/authors/id/GAAS/libwww-perl-5.47.tar.gz is the URL from which to download it.


jumaru
Deleted

Feb 25, 2000, 9:40 AM

Post #5 of 7 (1033 views)
Re: Open file [In reply to] Can't Post

I have downloded it, uploaded it and chmoded it; I haven't known how to use it
please help
the file is http://www.otherdomain.com/file.txt
how to read it in using LWP::simple
I'm new in perl


[This message has been edited by jumaru (edited 02-25-2000).]


Cure
User

Feb 25, 2000, 1:54 PM

Post #6 of 7 (1033 views)
Re: Open file [In reply to] Can't Post

Hi jumara

here a example that will fetch a file off the net.

#!/usr/bin/perl

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

Cure


jumaru
Deleted

Feb 26, 2000, 12:32 AM

Post #7 of 7 (1033 views)
Re: Open file [In reply to] Can't Post

Thanks Cure
it works but my question now is:
I have its content but I want to use what's in this file, delete some things and print it again
Can I do this ?
Thanks in advance

 
 


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

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