drewhead has asked for the wisdom of the Perl Monks concerning the following question:

A software supplier has data packed into a set of files whos format is unpublished. In order to access this data a set of .DLL files with an example VB program is provided. This seems a reasonable way to do things: here's an arbitary data format that I may change so access it with this API whose interface I'll keep constant for you. It just isn't cross platform.

Alas I know little to nothing about Win32 programming or VB, though reading the example sub declarations does leave me with a decent understanding of the input and output.

I need to be able to access some of the data in these data files on *nix, specfically Linux. The app that needs this data is in perl. Is there a way from perl on a non Win32 system that I can use the API in the DLLs?

I've done some searching and reading and found the Win32::API which looks like the right tool for the job maybe? But I gather this only works on Win32 perl since I don't seem to be able to install it on a linux system?

Are there any option available to me or am I stuck on Win32?

Replies are listed 'Best First'.
Re: Can I use Win32 DLLs on *nix perl?
by ikegami (Patriarch) on Dec 02, 2005 at 16:01 UTC
    You'd have to run your script in an Windows emulator like WINE. The code in the DLL won't work in unix because Windows system calls and unix system calls are different.
      winelib might also be helpful. It doesn't require running under wine, but rather links in a compatability library.
Re: Can I use Win32 DLLs on *nix perl?
by Fletch (Bishop) on Dec 02, 2005 at 16:05 UTC

    One option would be to create an (XMLRPC|SOAP|REST) server which runs on a Wintendo box and wraps the calls to the DLL. Your Linux box would make calls to that server rather than accessing the files directly. Granted this requires a separate box in the mix, but it might be less of a headache than getting something going under WINE.

Re: Can I use Win32 DLLs on *nix perl?
by Courage (Parson) on Dec 03, 2005 at 09:30 UTC
    While many people advice looking into WINE emulator, it makes (almost) full runtime support for DLL, there is another option

    It worth looking on how "mplayer" does this without WINE or something.
    (it does this for using codec DLLs directly)
    Grab a source and take a look!

    Best regards,
    Courage, the Cowardly Dog