The question I put before you is: How can I skip the save file to disk step and unzip the file directly from the UA's output? I understand that I can get a reference to $ua->content, but I haven't figured out how to pass that to a Archive::Zip object, which appears to only work on files and FHs.
This is the code I have right now, assume all objects were properly started before this snippit:
This works, but saves the file to disk on line 4. I want to be able to take $ua->contents and use it for the zip file on line 8, $zip->read ($file).foreach my $file ( @filelist ) { my $FILE_URL = qq ( $URL/$file ); my $request = HTTP::Request->new(GET => $FILE_URL ); my $res = $ua->request($request, $file); print $res->status_line, "\n"; my $zip = Archive::Zip->new(); $zip->read ($file); my $member = $zip->memberNamed( 'data.dat' ); my ( $string, $status ) = $member->contents(); die "error $status" if $status != AZ_OK; print $string; }
Any help would be nice.
--SparkeyG
japh
In reply to LWP::UserAgent interaction w/ Archive::Zip by SparkeyG
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |