kaka_2 has asked for the wisdom of the Perl Monks concerning the following question:
Hello PerlMonks,
I have a function which list files from specified directory based on the regex. i want an additional filtering which should be based on time. for example which fullfill below pattern condition and file should have minimum age of 15 minute. i now i can use -M test operator to do such filtering but i am not sure if this is possible with AND operator in the same sub with grep
Could someone help me with this?
Thank for your help. -KAKA-sub GetINDirFiles { my ($path) = @_; opendir DIR, $path or die $!; # my @files = readdir DIR; my @files = grep {!/\_NSA|_\d+_\d+\.xml/} readdir DIR; closedir DIR; return(@files); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: list files based on age and pattern
by CountZero (Bishop) on Sep 16, 2013 at 11:52 UTC | |
|
Re: list files based on age and pattern
by RichardK (Parson) on Sep 16, 2013 at 11:54 UTC | |
by kaka_2 (Sexton) on Sep 16, 2013 at 13:23 UTC | |
by hdb (Monsignor) on Sep 16, 2013 at 13:37 UTC | |
|
Re: list files based on age and pattern
by hdb (Monsignor) on Sep 16, 2013 at 09:42 UTC | |
by kaka_2 (Sexton) on Sep 16, 2013 at 13:18 UTC | |
by hdb (Monsignor) on Sep 16, 2013 at 13:24 UTC | |
by kaka_2 (Sexton) on Sep 16, 2013 at 13:56 UTC | |
by hdb (Monsignor) on Sep 16, 2013 at 14:28 UTC | |
by kaka_2 (Sexton) on Sep 16, 2013 at 10:09 UTC | |
by hdb (Monsignor) on Sep 16, 2013 at 10:16 UTC | |
by Happy-the-monk (Canon) on Sep 16, 2013 at 10:38 UTC | |
by hdb (Monsignor) on Sep 16, 2013 at 10:51 UTC | |
|