#!/bin/perl -w use strict; my $mytime=(time); my ($File,$FileStat,$CallOutDir); chdir 'C:/devl/bin/timedir' or die "Arghh!!! $!"; opendir(ROOT, ".") or die "Arghh!!! $!"; foreach $File (readdir(ROOT)) { next if $File=~/^\./; # I need to ignore one specific file from this list here and ignore *.filetype-x as well if ($FileStat = (stat $File)[9]){ if ($FileStat <= ($mytime - 300)) { print "File older than 5min found. The file name is $File"; #create C:\temp\warning.txt here.... last; } } }