From: david.karr on
I've written some scripts that manipulate Zip files using
Archive::Zip. I'm now working on a script that uses "LWP::Simple" to
download data from a URL. As part of this process I'm going to have
to download a zip file from a URL and then extract that zip file to a
particular directory.

Can I use LWP::Simple to download a binary file directly into a
variable?

I've looked at the Archive::Zip methods, and it doesn't appear as if I
can create the Zip object directly from the contents of a variable.
Will I have to download the zip file directly to a temporary file
(using "getstore($url, $file)"), I would imagine), and then create the
Zip object from that?

I see the "extractToFileHandle( $fh )" method on Archive::Zip. Is that
file handle supposed to be a directory?
From: david.karr on
On Apr 9, 3:34 pm, "david.karr" <davidmichaelk...(a)gmail.com> wrote:
> I've written some scripts that manipulate Zip files using
> Archive::Zip.  I'm now working on a script that uses "LWP::Simple" to
> download data from a URL.  As part of this process I'm going to have
> to download a zip file from a URL and then extract that zip file to a
> particular directory.
>
> Can I use LWP::Simple to download a binary file directly into a
> variable?
>
> I've looked at the Archive::Zip methods, and it doesn't appear as if I
> can create the Zip object directly from the contents of a variable.
> Will I have to download the zip file directly to a temporary file
> (using "getstore($url, $file)"), I would imagine), and then create the
> Zip object from that?
>
> I see the "extractToFileHandle( $fh )" method on Archive::Zip. Is that
> file handle supposed to be a directory?

Oh, never mind. Using "Archive::Extract" is much easier for
extraction.