
TheGame+
Deleted
Jun 13, 2000, 4:18 AM
Post #2 of 6
(452 views)
|
You could use the mirror() function from the same module. It really helps to RTFM, you know. <BLOCKQUOTE><font size="1" face="Arial,Helvetica,sans serif">code:</font><HR> #!/usr/bin/perl -w use LWP::Simple; use strict; # @all is filled somehow, assuming there are no trailing newlines and that file paths are correct foreach my $line (@all) { my @array = split(/\|/,$line); my $rc = mirror($array[0],"$array[1].db"); if (is_error($rc)) { print "Error retrieving or saving $array[0] : $rc ",status_message($rc),"\n"; } else { print "$array[0] : $rc ",status_message($rc),"\n"; } } </pre><HR></BLOCKQUOTE> Note that you will also get a "500 Internal Server Error" if the file cannot be saved for some reason - e.g. if it has an invalid local path.
|