in reply to Search windows folder for old files...

Unrelated to your question, but in the interests of improving your style you may find the following of interest:

#!/usr/bin/perl use strict; my $directory = "D:\\FTP-Accounts\\upload"; my $kMaxHours = 1; my $count; print "\n"; opendir my ($scan), $directory or die $!; while (my $name = readdir($scan)) { #next unless (-f "$directory/$_"); my $age = -M $name; print "$name - Days = $age\n"; $age *= 24; if ($age > $kMaxHours) { ++$count; print " * Triggersed * Hours = $_\n\n"; } } closedir $scan; print "\nFile Count - $count -\n"; if (! $count) { print "OK:"; exit 0; } print "\nWarning: file is older than $kMaxHours hours\n"; exit 1;

Points to note:

There may be other minor changes - can you spot them?

True laziness is hard work