Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I am using Win32::SerialPort to open a com port and send and receive commands. So, I say:
$portObj = new Win32::SerialPort ($PortName) || die "Oh no Can't open +$PortName: $^E\n"; # $quiet is optional
Sometimes, I connect with no problem, but many times, I get the following error when this line is executed:
can't open device: com1 at C:\perl\test.pm line 31
Oh no Can't open com1:
The die message does not give out any printout for $^E. I am not sure why the com port can not be opened sometimes...any advice?
Thank you in advance.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: using win32::serialport
by moot (Chaplain) on Apr 13, 2005 at 03:13 UTC | |
|
Re: using win32::serialport
by starbolin (Hermit) on Apr 13, 2005 at 16:06 UTC | |
by Anonymous Monk on Apr 13, 2005 at 17:11 UTC |