I am working (well in the planning stages really) on a script that interacts with the Amazon.com Web Services. No, this is not for the contest. I do not have the time nor the experience in Perl to even consider such an undertaking. In the documentation it states that, “Your Web site or application should make no more than one (1) request per second to our servers”. I am not sure how to go about this in Perl.
What I had in mind is storing the current time in seconds (epoch or something) in a MySQL database after every request has been made to Amazon.com. Then when a user would execute the script, it would then access that value every time a request is made to Amazon.com. I would then compare this database value with the current time and if they are the same I would sleep(1000) and then do it again. If they are not I would then make the request to Amazon.com. This seems to be a bit sloppy to me, there has to be a more efficient way to do the above. All of these database accesses seem a bit much. I was also thinking about creating a daemon but it seems that my hosting provider charges an extra fee for running daemons.
Any suggestions would be helpful. I am still new to Perl, so please bear with me.
Thanks
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |