develooper Front page | perl.beginners | Postings from February 2002

Re: Time sensative Sub Routine

Shaun Fryer
February 22, 2002 16:30
Re: Time sensative Sub Routine
Message ID:
I did this by storing the data as an associative array within a
database. The HTML form where the person inputs their message POSTS
the data to a CGI which then inputs it into a database with the
current localtime(time) used as a unique key. The date the person
selected for delivery is also converted into Perl's localtime(time)
format as one of the associated array elements. Cron then periodically
executes another CGI which checks the database, and if the timestamp
in the array is in the past, it prints the corresponding data to
"|sendmail -t". Doing the localtime(time) conversion in reverse is a
little tedious to work out, but it functions very reliably once you
get it down.

 Shaun Fryer
 London Webmasters
 PH:  519-858-9660
 FX:  519-858-9024
=================== Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About