Hello gtk

I would followed the same way as the fellow monk shmem has already proposed, with a bit of twist.

I would use File::Find::Rule and stat in combination with git CPAN modules. Why to use all of these modules? Simple, I would check all the files in all the directories that I would like to observe. As a second step I would check when was the last updated date and based on a condition e.g. if they have changed since a specific date then check with the assistance of git what has changed and by whom? Job done ;)

Sample of code with half of the solution:

#!/usr/bin/perl use strict; use warnings; use File::stat; use Data::Dumper; use Time::localtime; use File::Find::Rule; sub get_files { my @dirs = ('/home/user/Monks' , '/home/user/Monks/mySubDir'); # a +dd more my $level = shift // 2; # level to dig into my @files = File::Find::Rule->file() ->name('*.xml', '*.txt') # add your file(s) extension(s) ->maxdepth($level) ->in(@dirs); return @files; } my @files = get_files(); my %hash; for (@files) { $hash{$_} = ctime(stat($_)->mtime); } # or # for (@files) { $hash{ctime(stat($_)->mtime)} = $_; } print Dumper \%hash; __END__ $ perl test.pl $VAR1 = { '/home/user/Monks/ArabicCharacters/original.txt' => 'Fri Jul + 28 13:21:04 2017', '/home/user/Monks/out.txt' => 'Thu Jul 20 13:29:41 2017', '/home/user/Monks/filter.txt' => 'Thu Jul 13 11:03:53 2017', . . . };

If you do not know what git is, or if you have never use it before read this git - the simple guide.

Hope this helps, BR.

Seeking for Perl wisdom...on the process of learning...not there...yet!

In reply to Re^3: Method to verify an environment with changes by thanos1983
in thread Method to verify an environment with changes by gtk

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.