#!/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=~/^\./; next if $File =~/\._Checking_File_Readiness_$/; # This is the *.filetype I want to ignore next if $File =~/\_Watched_Folder_Active_$/; # This is the single file I'd also like to ignore if ($FileStat = (stat $File)[9]){ if ($FileStat <= ($mytime - 300)) { print "File older than 5min found. The file name is $File"; #send mail here.... last; } } }