Great Monks! I am trying to unzip some .txt files using IO::Uncompress::Unzip in the code snippet below. Am getting this error though, which i suspect is to do with unseen folders in windows;
.
Use of uninitialized value $_1 in string eq at C:/Strawberry/perl/lib/IO/Compress/Base/Common.pm line 280. unzip failed: input file '.' is a directory

Below is the code

opendir(ZIPPED, $zipdir)or die "couldn't open $zipdir: $!\n"; my @zd = readdir(ZIPPED); my @uzd; foreach(@zd) { my $inf = $_; my $outf = $uzd[@uzd]; # print $_,"\n"; unzip $inf => $outf or die "unzip failed: $UnzipError\n"; }

Below is sample of the output i get if i run the print line and comment out the unzip line;
.
..
730372_Atoll.zip
730376V01_Atoll.zip
730378V01_Atoll.zip
730691_Atoll.zip
732689_Atoll.zip
732690_Atoll.zip
732691_Atoll.zip
How can i get past the "." and ".." and get unzip to uncompress the files. Thanks!


In reply to unzip fail using IO::Uncompress::Unzip by keienn

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.