Hello all... Thank you very much... I found my mistake (I'm new to perl still on the learning curve)... The code listed below is what i am using... I would like to thank you Monks for taking the time to assist me... I have discovered that I enjoy using PERL... I have so much more that I want to discover with it...

Thank's Darrick...



sub get_logfiles {
 opendir (Directory, $pth) or die "Cannot Open Directory";
 @contemps = readdir(Directory);
 closedir(Directory);
 splice(@contemps, 0, 2);
 foreach (@contemps) {
  if (m/^[B|b].+.txt$/) {
   push(@contents,$_)
  }
 }
 undef(@contemps);
 sort(@contents);
 foreach $content (@contents) {
  $logfile = "$pth" . "\\" . "$content";
  if( -M $logfile < 1 ) { #less than 24 hours ago
  #if( -M $logfile < 13 ) { #less than 13 days ago
   open(FILE, "$logfile"); # open logfile for reading
   print "   ***$logfile is in specified date range - processing***\n";
   &do_log;
   &write_out;
   close(FILE);
  }
  else {print "   ***$logfile is out of date range - skipping***\n";
  }
 }
}

In reply to Re: If logic fails foreach mistake by dbrock
in thread If logic fails foreach mistake by dbrock

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.