From Win32::SerialPort:
Version 0.15 adds an optional $quiet parameter to new. Failure to open a port prints a error message to STDOUT by default. Since only one application at a time can "own" the port, one source of failure was "port in use". There was previously no way to check this without getting a "fail message".(italics added by starbolin) Setting $quiet disables this built-in message. It also returns 0 instead of undef if the port is unavailable (still FALSE, used for testing this condition - other faults may still return undef). Use of $quiet only applies to new.
This would imply something like:
I don't think $^E will have any information in either case as the port is not setup yet only the control block is being created and even that has failed, but that's an untested assumption.{ $|++;print "\rPort Busy ",$i++;sleep 1; die "Can't wait any longer\n" if ($i>=15); } while (($portObj = new Win32::SerialPort ($PortName, $quiet))==0); die "Other reason for not working: $!\n" if ($portObj==undef);
If you haven't already, you should fully explore the resources on Bill's page
Good luck
In reply to Re: using win32::serialport
by starbolin
in thread using win32::serialport
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |