"unzip failed: input file '730372_Atoll.zip' does not exist"That looks like
a directory problem. Remember that readdir only returns the file name, not the
a complete path to the file. You need "$zipdir/730372_Atoll.zip" otherwise
the .zip file is expected in the current directory wherever the Perl script
is running. You could add the full file path instead of just the file names
from readdir into @zd array by using map:
my @zd = grep {!-d}map{"$zipdir/$_"}readdir(ZIPPED);
I looked at IO::Uncompress::Unzip I
suspect that you are using the wrong tool. If you unzip $inref => $outref
and my $inref = \@zd;, that is fine. However, your assignment of filenames
to the output arrary ref is meaningless. see Notes:
When $input_filename_or_reference maps to multiple compressed files/buffers
and $output_filename_or_reference is a single file/buffer, after uncompression
$output_filename_or_reference will contain a concatenation of all the uncompressed
data from each of the input files/buffers.
You will just get a bunch of concatenated junk in @uzd.
Try reading Archive::Extract and
look at Re: Archive::Zip for unzipping to directory?
Try writing some code that just extracts one .zip file using a hard coded name and puts the contents
where you want it, then work on making a loop with varying dir contents.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.