I plead guilty to whatever XY drift there is in the unrolling specification here, but a proper sailor in high seas will not abandon his complete mystification without reporting it as well as he can, for others with better perspective perchance to hear. It would seem files in the local::lib are not possessed of a,c, or mtime, whilst my crummy modules have all 3. My current best script follows with abridged output.

use strict; use warnings; use 5.014; use File::Find; my @directories_to_search = ( '.', 'C:\Users\Fred\Desktop' ); my @files; find( \&wanted, @directories_to_search ); my @time = localtime; say "local time is @time"; sub wanted { if ( $_ =~ m/.pm$/ ) { my $name = $File::Find::name; my $success = max_acm($name); say "max_acm is $success"; push( @files, $name ); } } sub max_acm { use strict; use 5.014; use warnings; my $path = shift; say "$path is $path"; my @array; push @array, 42; my $atime = ( stat $path )[8]; if ( defined $atime ) { say "atime is ok"; push @array, $atime; } my $ctime = ( stat $path )[10]; if ( defined $ctime ) { say "ctime is ok"; push @array, $ctime; } my $mtime = ( stat $path )[9]; if ( defined $mtime ) { say "mtime is ok"; push @array, $mtime; } my $max = ( sort { $b <=> $a } @array )[0]; return $max; }
max_acm is 42 ./perl5/lib/perl5/Prompt/Timeout.pm is ./perl5/lib/perl5/Prompt/Timeou +t.pm max_acm is 42 ./perl5/lib/perl5/WWW/Mechanize/GZip.pm is ./perl5/lib/perl5/WWW/Mecha +nize/GZip.pm max_acm is 42 C:\Users\Fred\Desktop/alpaca/template_stuff/config1.pm is C:\Users\Fre +d\Desktop/alpaca/template_stuff/config1.pm atime is ok ctime is ok mtime is ok max_acm is 1465162519 C:\Users\Fred\Desktop/alpaca/template_stuff/html1.pm is C:\Users\Fred\ +Desktop/alpaca/template_stuff/html1.pm atime is ok ctime is ok mtime is ok max_acm is 1465162519

The times I'm looking for *in this context* are bounded below by when they become files in this locale. As further indication of XY shift, I would stipulate that it is sufficient to take the max of them, just in order to make useful time comparisons that will work for gilligan's island. I could just as well write a min function, compare it to the max, and have an interesting statistic about age, but first I'm trying to get squared away with the material in the exercises. I'm still *finding* modules, so I have to wonder how perl is interpreting the underlying windows platform. 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.

Again, thanks for your comment.


In reply to Re^2: using File::Find to find recently-installed modules by Aldebaran
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.