Tony Esposito wrote:
Cheers!
New to LWP and downloading file/copying file from Web to local box. Had a go
at it and failed horribly... On Solaris 10 with Perl 5.10.
#!/usr/bin/perl -w
use strict;
use LWP::Simple qw($ua get);
my $webpage ="https://www.mywebpage.com/Documents.zip";
$ua->timeout(20);
my $content = get $webpage or die "Page timed out...$!\n";
if (defined $content) {
open FILE,"> Documents.zip" or die "Can't create file";
binmode FILE;
print FILE $content;
close FILE;
} else {
print "LWP get() failed\n";
}
exit;
Don't see where I authenticate -- login and password, that is. Get system
timed out as an error. Any help would be grateful.
I suggest you use WWW::Mechanize instead.
http://search.cpan.org/~petdance/WWW-Mechanize-1.62/lib/WWW/Mechanize.pm
It is design for stateful websites, that is, those with logins.
--
Just my 0.00000002 million dollars worth,
Shawn
Programming is as much about organization and communication
as it is about coding.
I like Perl; it's the only language where you can bless your
thingy.
Eliminate software piracy: use only FLOSS.
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/