You would have to have the source-code of the big software package in question ... and a helluva lot of time and energy ... to build a new macro processor into it. Only if the application is "otherwise externally controllable" could a different language e.g. Perl be used to control it. For example, if a Windows package fully supported OLE.
Comment on Re: Replacing builtin macro languages with perl -- how difficult?
As Java has reflection (which basically can be construed as OLE), there is a possibility to create a Java-Perl bridge where Perl code can issue calls to Java. See for example Inline::Java.
This is still a huge lot of work and replacing one macro language interpreter with another one is not easy.