That neither a,c nor m time for the unix installed modules exists knocks my socks off and, along with the sea forward and backslashes, makes me believe that my logic is faulty.

The issue is that you have a relative path, the '.' File::Find does a cd as it navigates downwards. By the time you do the file test, you are not where you think you are and the file test fails. Since you are actually "in the directory", you can use the simple name of the file, eg. just "Timeout.pm". File::Basename can get that from $File::Find::name. The branch which started with an absolute path name works fine because it doesn't matter what directory that you are in when you do the stat.

update: It is not necessary to use "\" on Windows. The "/" will work just fine. That is also true from the command line. The "\" is a hold over from DOS days and causes obvious problems due to its special meaning in Perl.

Also worthy of note are side effects of this changing working directory business. If you code something that could "blow up" in Find, you will be left in some random part of the directory tree.

Update:
Here is some code to demo what I've said. I started in the ".." directory and used basename($File::Find::name) to do a simple file test on the basename.

#!/usr/bin/perl use warnings; use strict; use File::Find; use File::Basename; find (\&for_every_name,'..',); sub for_every_name { my $basename = basename($File::Find::name); return unless $basename =~ /\.pl$/; print "$File::Find::name\n"; my $access_age = -A $basename; print " $basename, acccess age in days: $access_age\n"; } __END__ Abridged output: ../SSPH_Results/cmpN1MMarrlresults.pl cmpN1MMarrlresults.pl, acccess age in days: 40.9642361111111 ../SSPH_Results/convert2oldCSV.pl convert2oldCSV.pl, acccess age in days: 17.5422685185185 .....deleted..... ../testing/FileFinder.pl FileFinder.pl, acccess age in days: 1.15740740740741e-005 Note: *** "FileFinder.pl" is the name of this file, hence the Note: *** very short last access time! ../testing/fileFindexample.pl fileFindexample.pl, acccess age in days: 0.110034722222222

In reply to Re^3: using File::Find to find recently-installed modules by Marshall
in thread using File::Find to find recently-installed modules by Aldebaran

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.