[EMAIL PROTECTED] wrote: > > Hi, i wonder how i can get only the files that are modified > less than a hour for exemple in a directory. > How can i do this in Perl?
Use stat or lstat to get the mtime and compare it to the current time. The times used are in seconds so one hour would be 3600 seconds. Using a file glob: my @files = grep time - (lstat)[9] < 3600, <directory/*.txt>; Or using opendir and readdir: my $dir = 'directory'; opendir D, $dir or die "Cannot open $dir: $!"; my @files = grep time - (lstat "$dir/$_")[9] < 3600, readdir D; closedir D; John -- use Perl; program fulfillment -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
