Hello-
This is a really basic question, sorry. Can anybody tell me why I get the
following error when I run this script:
"Use of uninitialized value in numeric lt (<) at ./x2 line 8"
#!/usr/bin/perl -w
opendir DIRH, "/home/dwk/test" or die "can't open it: $!\n";
@allfiles = readdir DIRH;
closedir DIRH;
foreach $temp (@allfiles) {
if (-M $temp < "0.5") {
print "$temp\n";
} else {
print "$temp is older than 12 hours\n";
}
}
I just want it to be able to distinguish between files that are older than
12 hours, and those that are newer (then I will build on it to do better
things than just print).
Thanks
David