as I mentioned in Interact with mainframe screen, I am using the OLE interface of IBM Personal Communications 3270 emulator to perform automated tasks on a mainframe. However, some sessions get stuck when 3 or 4 sessions are used in parallel. So I tried to find another way...and I found it. Starting at version 4.1 or 4.3 (don't know exactly), a DLL EHLAPI.dll is provided with PCOMM to interface C or Java applications with the emulator, and I also found Win32::API.

Once everything is put together, I managed to have some interaction between Perl script and the 3270 emulator with the following code.It is a just a simple one, but works, and shows an increase speed execution(and hopefully less buggy).

here are the pages I found of interest to help me interface my Perl script with the EHLLAPI of the PCOMM:

A quick benchmark, only with the seconds elapsed, shows that for the same queries, the OLE version took around 60 seconds to execute, were the EHLLAPI version tooks only 15 seconds ! Until now I thought that the cause of the 'slow' execution time was due to the execution time of the query on the mainframe, or to the communication between the emulator and the mainframe, but most of the time was spent on the OLE interface.