ytjPerl has asked for the wisdom of the Perl Monks concerning the following question:
use strict; my $DIR = "C:/Users/tyang/Documents/Traning"; opendir DIR, $DIR or die "could not open directory: $!"; while (my $file = readdir DIR) { my @files = grep ( -f ,<*.txt>); # Write them out foreach (@files) { print $file, ' '; my $age = -M $file; if ($age > 7) {print "the age is", int($age),"old than a week\n";} } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: print out certain extension files
by haukex (Archbishop) on Sep 08, 2017 at 18:36 UTC | |
by ytjPerl (Scribe) on Sep 08, 2017 at 19:06 UTC | |
by Cristoforo (Curate) on Sep 08, 2017 at 19:10 UTC | |
by Anonymous Monk on Sep 08, 2017 at 19:10 UTC | |
|
Re: print out certain extension files
by Laurent_R (Canon) on Sep 08, 2017 at 18:47 UTC | |
|
Re: print out certain extension files
by thanos1983 (Parson) on Sep 09, 2017 at 14:15 UTC |