in reply to File manipulation

I prefer to store all of my timestamps as epoch seconds. Perl's built-in time returns the number of epoch seconds since January 1, 1970. As long as you have the epoch seconds, you can always figure the rest out. It's a good consistent trick to have.

For example: pick a date, what was date before that? If you picked Jan 15 then the answer is Jan 14, no matter what year. But what if you picked March 1?

However, by taking advantage of epoch seconds, you can easily figure out what yesterday was:

my $yesterday = time - (60 * 60 * 24); my ($d, $m, $y) = (localtime($yesterday))[3,4,5]; $yesterday = sprintf("%04d/%02d/%02d", $y += 1900, $m += 1, $d);

Jeff

R-R-R--R-R-R--R-R-R--R-R-R--R-R-R--
L-L--L-L--L-L--L-L--L-L--L-L--L-L--