Hi there!
I am trying to identify files in a directory by the day, they were created.
My "algorithm" is like that:
Code:
foreach $file (@directory){
$file_timestamp = (a);
$today_timestamp = (b);
if(file_timestamp >= today_time_stamp){
# here comes more
} else {
# file will be ignored
}
}
Now the 2 problempoints I have are marked with (a) and (b). I found alot of snippets to this topic but it is confusing me right away. I am not that Perl-guru ...
The Questions:
(a) solved.
(b) Hot do I get the timestamp of the beginning of a day? 00:00:00h on 11/24/2006 for example?
I always get this error: Can't call method "mtime" on an undefined value at........
from this code: stat($file)->mtime; Why is that???
Or is there a better solution than my idea, that I might understand?
Thanks a lot,
Greetings Sascha