I see a number of problems.
First forget this '\' stuff! That is ancient DOS. Modern Windows command line is NOT DOS and it works fine with '/'. In your code always use forward slash ('/') instead of backslash ('\'). This amoungst other things avoids the need to "double escape" the backslash. Again, forget this '\' stuff!
my $base = 'D:\Some\Specific\Folder\Archive\\'; # should be: my $base = 'D:/Some/Specific/Folder/Archive'; # a path to a directory or my $base = "D:/Some/Specific/Folder/Archive"; # a path to a directory # do not put a trailing '/' or '\' on a directory name # this is not needed and can confuse the shell # pre-pend a '/' when you expand the path my $new = "$base/$extra_path";
Your triple loop over $year,$month,$day is truly bizarre.
my @files = glob qq($base\\Gridfee0?.7z\\Gridfee?\\invoic_ +b2c_$year$month$day*.txt);
What are you trying to do there? I don't quite "get it".

I am curious as to why you are using .7z suffixes? I like 7z. It generates .zip files faster which use less memory than the MS zip program does. These .zip files generated by 7z are compatible with Windows .zip. I've never used the .7z specific format because the .zip MS compatible format appears to be just fine for my applications. Again, if 7z makes that .zip it will be smaller than what MS does, be generated faster and yet be compatible with MS .zip.


In reply to Re: Extracting files from .7z using Perl by Marshall
in thread Extracting files from .7z using Perl by zarath

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.