in reply to PERL for tool and testing automation
There are some results on CPAN, but I suspect not what you're wanting.
You must also provide some context about what Modelsim and and how it's normally used. There are very smart people here and they can figure it out, but you don't want them wasting time researching information you can provide.
Perl can handle it all, but unless you share how you expect to interface with Modelsim, then the amount of help you'll receive will be limited. Is Modelsim a black box that can be interacted with as an external program (via API, as an external process, output files)? Is it a collection of compiled libraries that can be interfaced using a Foreign Function Interface?