I have never worked with StarOffice from perl, but here are a few thoughts ...
- If this is Windows, see if StarOffice has an OLE interface (i think it does), and check out Win32::OLE.
- (non-perl) Use a GUI macro recorder. (available for both Win and X)
- use the C-API for the macros, some XS magic, and make many monkly friends. :)
from the frivolous to the serious