first off use strict if you can,
second:
try put this on one line,
- $PortObj= new Win32API::CommPort ('com4')
-
|| die "Can't open PortName: $^E\n";
try
- if ( ($PortObj->WaitCommEvent(com4, EV_RXCHAR, ERROR_IO_INCOMPLETE )) )
-
{
don't forget to take out ' ' for your handle.
or
- if ( ($PortObj->WaitCommEvent(com4, EV_RXCHAR, )) )
-
{
usage for above:
- WaitCommEvent($handle, $Event_Bitmask, $lpOverlapped);