in reply to Re: Testing dll/dso using Perl
in thread Testing dll/dso using Perl

Hi, Thanks for the response. It was a good start for me. But Win32::API documentation says "With this module you can import and call arbitrary functions from Win32's Dynamic Link Libraries (DLL), without having to write an XS extension. Note, however, that this module can't do anything (parameters input and output is limited to simpler cases), and anyway a regular XS extension is always safer and faster." The application I'm gona test is kind of complex. I may need PerlXS. For example: one of the interface method (to read a file) signature is: int FileSystemInputStream::Read(void* destination, size_t size, Common::LogContext& log, int logAndExceptionLevel) How to call this method in Perl to test its functionality? Can u pls thro light on PerlXS? Is it possible to use the same PerlXS on both Windows(dll) & Unix(dso)? Thanks a lot!

Replies are listed 'Best First'.
Re^3: Testing dll/dso using Perl
by Joost (Canon) on Mar 23, 2005 at 10:14 UTC
    If you are going to pass around complex objects, you might find it nessesary to use XS, but maybe Inline::CPP is smart enough to get it to work. Try inline first, it shouldn't take long to test, and you can always convert to XS later.

    XS is more low-level, meaning it requires you to "spell out" more of the C/Perl-interface code, but it also gives you the most flexibility. Swig is like XS but language-independant (and from what I heard, slightly easier than XS) but I haven't used it at all. Both Swig and Inline::C(PP) produce XS code, by the way.

    It's possible to use the same XS code in win32 and unix; it should be slightly easier than writing portable C, since you're linking against perl, which provides a lot of platform-independent routines. See perlapi, for instance.