in reply to Win32::OLE, TPJ#10, linux

Win32::OLE only works on Win32, as OLE is one of the core services provided by the Windows API. Without understanding the differences involved here, you don't have much hope of succeeding in any way here.

What you could do is to emulate the RPC calls of Win32/NT, from what I remember, this is pretty standard RPC, and use DCOM to automate the Win32 Applications from a second machine. But DCOM is only COM and not completely OLE, so you're setting yourself up for lots of pain here. A second solution would be to install Perl on the Win32 machine and just use that. Not much pain involved here. You also could use the Openoffice.org automation, but their document model is horribly broken and really ugly to use.

Replies are listed 'Best First'.
Re^2: Win32::OLE, TPJ#10, linux
by Anonymous Monk on Sep 06, 2004 at 11:18 UTC
    Thanks.

    If we put OLE and ActiveState on an XP box, but the 'brains' and driving logic had to live on the linux side, what communication protocol would you recommend for the 'nix machine to ask the XP machine to do OLE actions and pass data back and forth?

    We would be seeking a protocol that is (1) friendly for a developer team that has never done this before, (2) relatively easy to set up, (3) robust, and (4) NOT handrolled.

    Any such thing exist?

    Thank you very much.

      Don't do a tightly coupled system. Pass RTF files, CSV files or whatever from the Linux side to the Win32 side, and have a Perl program monitor the drop directory. Then import the data into Office, munge it and spit it out again.

      Another (bad) idea would be to push over actual Perl code to be executed instead of data files, but if you already look in that direction, consider a database to handle outstanding jobs etc. You will have to have Perl code on the Win32 machine in any way, and I would try to avoid any fancy RPC scheme in favour of file based transfer or DB based transfer, where the advantages and disadvantages of both are to be weighed.

      You obviously haven't done much research in the direction, so here are some dire warnings:

      1. Office is single user. If you have more than one process trying to automate things, you are asking for much trouble.
      2. You might be well better off to use SpreadSheet::WriteExcel or simply distributing .pdf files or csv files instead of trying to produce them via OLE.
        Many thanks Corion. We greatly respect your postings.

        If you could, could you explain your suggestion, "Don't do a tightly coupled system"??

        Could you comment on the suggestion to use SOAP::Lite (below)?

        Thank you very much for your advice and wisdom!

      Give SOAP/XMLRPC a chance. It is very easy to handle - if you dont mind about performace. Check: http://soaplite.com/features.html In one of my former project I used xmlrpc - If you have fixed IPs and no transaction handling it is really one of the easiest 'middlewares' i ever used.