I have a web application that integrates with 37 Signals' Highrise for customer management. I need a collection of Perl subroutines that can manage the integration with Highrise. The code needs to be able to do the following:
1. Connect to Highrise using a provided Highrise API token
2. Obtain a list of all contacts for that user as well as as well as email address(es), phone number(s), and street address(es) for each contact. In some cases there might be more than 4000 contacts
3. Cache the information in a MySQL database so that it can be rapidly accessed by the Perl code without having to be loaded from Highrise every time
4. Update the cache with any changes to the data stored in Highrise. In other words, if new contacts are added to Highrise they need to be added to the cache. If they are changed in Highrise they need to be changed in the cache. If they are deleted in Highrise they need to be deleted from the cache
5. The code should also be able to send changes back to Highrise. In other words, if a contact is updated in the cache by the Perl application, then the cache management code needs to see that change and submit the change back to Highrise.
The typical use of the system is as follows: