*** 이력서 기능을업데이트 된 코드* *다운로드하는 방법`decoded_content`
my $ua = LWP::UserAgent->new;
$ua->credentials('$ip:80', 'Realm', 'username', 'password');
my $response = $ua->mirror($url,$newfile);
if ($response->is_success) {
print "Download Successfull.";
}
else {
print "Error: " . $response->status_line;
}
** * ** * * *이전 코드* ** * ** * ** * ** * ** * *
my $ua = LWP::UserAgent->new;
$ua->credentials('$ip:80', 'Realm', 'username', 'password');
my $response = $ua->get($url);
if ($response->is_success) {
print "Retrieved " .length($response->decoded_content) .
" bytes of data.";
}
else {
print "Error: " . $response->status_line;
}
open my $fh, '>encoding(UTF-8)', $tmp;
print {$fh} $response->decoded_content;
close $fh;
if (-e $tmp) {
my $filesize = (stat $tmp)[9];
my $origsize = $queue[$rec][1];
if ($filesize < $origsize) {
print "Resuming download";
******************************************
code for resuming the partly downloaded file...
*******************************************
}
else {
print "File downloaded correctly\n";
}
}
내가 펄 안돼서으로 , decoded_content
을 다운로드 할 수 있습니다, 일부 오류는 계속 발생하지만. 부분 파일이있는 경우 파일 다운로드를 다시 시작해야합니다.
이것은 내가 시도한 코드이지만 어디서부터 시작할 것인지 알 수 없으므로이 점에 대한 빠른 생각은 실제로 큰 도움이 될 것입니다. 이걸 도와주세요.
어쩌면 책을 읽기 시작해야 할 것입니다. 어때? [이 하나] (http://www.amazon.com/Learning-Perl-Randal-L-Schwartz/dp/1449303587/ref=sr_1_1?ie=UTF8&qid=1337074010&sr=8-1) –
읽고 나서 [편집] (http://stackoverflow.com/posts/10597630/edit) stackoverflow에 맞게 귀하의 질문. –