I made a few modifications
That's unforunate.
$path = $dir."/".$file; doesn't really save you anything over catfile and it's less portable.
Reguarding xxx if yyy, most people avoid hiding the intent of the statement in yyy like you did.
I noticed you removed "\n" from the error message. If your error message relies on the line number to be readable, it isn't. It's particularly bad to display the line number in this case because the error is a user input error.
You unbound the scope of $dh, $mtime and $path by removing my. That's just plain wrong.
Four steps backward.
Now how would I compare it to a date
Two approaches:
Use if (-M $path < 2) to check if it's too old. Documented in -X.
Do my $time_limit = time() - 24*60*60; outside the loop, and use if ($mtime < $time_limit) to check if it's too old.
In reply to Re^3: accessing file attibutes
by ikegami
in thread accessing file attibutes
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |