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.
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
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |