in reply to Comparison Of Files
use Time::Local; my $sec = 0; my $min = 0; my $close = 17; ## 5:00 pm my $open = 9; ## 9:00 am my $spd = 24 * 60 * 60; my $yes = time - timelocal( $sec, $min, $close, (localtime( tim +e - $spd ))[ 3, 4, 5 ] ); my $morning = time - timelocal( $sec, $min, $open, (localtime)[ 3, +4, 5 ] ); my $dir = '/'; ## where the files reside( rem ending slash ) my @cellsites; opendir CELLSITES, $dir or die "opendir"; @cellsites = map{ $_->[0] } grep{ $_->[1] <= $yes && $_->[1] >= $morning } map{ [ $_, ( ( -M "$dir$_" ) * $spd ) ]} readdir CELLSITES; closedir CELLSITES; ## print @cellsites to a file ## or to screen, or something
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
(tye)Re1: Comparison Of Files
by tye (Sage) on Dec 06, 2000 at 05:32 UTC |