Think about Loose Coupling | |
PerlMonks |
Re: File expiration dateby andreychek (Parson) |
on Jun 07, 2001 at 20:22 UTC ( [id://86629]=note: print w/replies, xml ) | Need Help?? |
Well, I'm wondering if it might be easier for you to use a database, as opposed to files. What you could for every classified ad is have a field for (amongst other things) the ad itself, and the day it was posted. Whenever it is posted, just use Perl to generate a datestamp and put it into that database field. Then every evening, you could have a cron job to dig through the database and expire (delete?) entries that are 7 days old. To use a database this way, you wouldn't even be required to have a full fledged database server running in the background, you could use something as simple as CSV files if thats what you want. OTOH, MySQL and Postgres come pretty cheap :-) -Eric
In Section
Seekers of Perl Wisdom
|
|