예제 코드 :: content_file 옵션을 사용하지 않고 응답을 파일로 처리하려면 어떻게합니까?
my $ua = LWP::UserAgent->new;
my $response = $ua->get('http://example.com/file.zip');
if ($response->is_success) {
# get the filehandle for $response->content
# and process the data
}
else { die $response->status_line }
나는 이전에 디스크에 저장하지 않고 파일로 내용을 열어야합니다. 어떻게 할거 니?
또는 더 효율적으로,'내 $의 FH를 열고, '<', $ 응답 -> content_ref,' – cjm
쿨, I 'content_ref'에 대해 알지 못했습니다. 나는 대답을 업데이트 할 것이다. – friedo