in reply to Re: Examples of Archive::Zip
in thread Examples of Archive::Zip
Since s/he is planning to output this to the browser, you'd think the writeToFileHandle() method will suffice (to STDOUT). If s/he does wind up needing it in a scalar (for some perverse reason, I can think of no good reason for needing this), s/he could use something like this to get the contents of $zip into $scalar:
# recent perl's: open( my $fh, '>', \my $scalar ) or die "open failed: $!"; $zip->writeToFileHandle($fh); # recent & odler perl's: use IO::Scalar; # or: # use IO::String (apparently more recent than IO::Scalar) my $fh = IO::Scalar->new(\my $scalar); $zip->writeToFileHandle($fh);
|
|---|