Store the last time an email was sent as the create/modification date of a file (or as data within the file). Check the time elapsed every time you want to send another email.
if ($condition_requires_email) { if (-e 'last.email' && -M 'last.email' < 1.0/24.0) { print "Don't need to send email yet\n"; } else { &send_email(); system('touch','last.email'); } }
Update: corrected logic error pointed out by jhourcle.
In reply to Re: Email Thresholding
by GotToBTru
in thread Email Thresholding
by bfdi533
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |