in reply to Using Win32::SerialPort in a module

Although I probably can't help with debugging your situation, one suggestion that I have is to maybe look at the source code of Control::CLI. On Windows, it uses Win32::SerialPort for serial port connections. Since this module is basically using Win32::SerialPort like what you're trying to do, it might be helpful to look at its source code for ideas on to do this in your code.

  • Comment on Re: Using Win32::SerialPort in a module

Replies are listed 'Best First'.
Re^2: Using Win32::SerialPort in a module
by jmClifford (Beadle) on Sep 07, 2024 at 03:01 UTC

    Hi. Thanks people. I feel I am compliant with requests with the following in the .pm module and .pl program.

    --------------------------------- Within the .pm module --------------------- package Serial; require Exporter; Exporter->import('import'); #Now declare what we permit to be visible within this module. our @EXPORT = qw( &Serial_Init &Serial_TrxRcv &Serial_Close); --------------------------------- Within the test .pl program --------------------------- use lib '.'; # The Serial.pm is in the current folder use Serial; # use a "1 off type of macro expansion" of the Seria +l module Serial_Init(); # Initialise the interface ---------------------------------

    I find the line in .pm of "Exporter->import('import');" to be un-intuitive. Possibly it relates to the importing on the .pl program ?

    I need to check out module CLI (ta)

    Regards JC.....