$PortName = "COM24";
$PortObj = new Win32API::CommPort ($PortName)
|| die "Can't open $PortName: $^E\n";
# die if the modem is mapped to port that is higher then 9 ("COM24" here).
# "query modem" using device manager is successful.
# When I re-assign the modem port to "COM4", the new works just fine.
$ob->baudrate(38400);
$ob->parity("none");
$ob->parity_enable(1); # for any parity except "none"
$ob->databits(8);
$ob->stopbits(1);
$ob->handshake('rts');
my $baud = $ob->baudrate;
print "baud from configuration: $baud\n";
$ob->write("ATE0X4\r");
sleep 1;
my $result = $ob->input;
print "result = $result\n";