perl and internt functions

D

dana livni

i need to connect a certain url and save his source in a directory on
my personal computer.

how do i do it?
hoping someone could help me
 
T

Tad McClellan

dana livni said:
i need to connect a certain url and save his source in a directory on
my personal computer.

how do i do it?


use LWP::Simple; # untested
get_store 'http://www.perl.org', 'some/dir/perl_org.html';


See also this Perl FAQ:

How do I fetch an HTML file?
 
D

dana livni

i tried to do so and i get this error:
Undefined subroutine &main::get called at link_list.pl line 11.

so i add this to my script:
my $content = LWP::simple->get("http://www.perl.com/");

and then i got this error:
Can't locate object method "get" via package "LWP::simple" (perhaps you forgot t
o load "LWP::simple"?) at link_list.pl line 11.
 
T

Tad McClellan

dana livni said:
i tried to do so and i get this error:
Undefined subroutine &main::get called at link_list.pl line 11.


Did you load LWP::Simple?

use LWP::Simple;

so i add this to my script:
my $content = LWP::simple->get("http://www.perl.com/");
^
^
^
Case matters.

my $content = LWP::Simple->get("http://www.perl.com/");

and then i got this error:
Can't locate object method "get" via package "LWP::simple" (perhaps you forgot t
o load "LWP::simple"?) at link_list.pl line 11.


Did you load LWP::Simple?
 

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

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,534
Members
45,007
Latest member
obedient dusk

Latest Threads

Top