Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- problem in using win32::SerialPort
September 7, 2007, 6:27 am
rate this thread
I am using win32::SerialPort in my perl application.
I am able to read and write at COM1 using API of win32::SerialPort
Now I am trying to open a port which does not exist on my machine(e.g.
When I open this port , I get an error
****" Can't open \.\COM3: The system cannot find the file specified"
and application exits.
I dont want to get my application exit after this.
I read the manual of win32::SerialPort and found that using $quiet I
can get return value 0 if port is not opened.
Below is my code I have used
$quiet = 1;
$PortObj = new Win32::SerialPort ($_, $quiet)
|| die "Can't open $_: $^E\n"; # $quiet is optional
if($PortObj == 0)
I set this $quiet to 1 but my application still exits.
Actually my board is connected to one of the port on the PC.Now I want
to open ports from COM1 to COM20 and see on which port my board is
But as soon as my application comes across any port which it is not
able to open it shows me the above mentioned message(****) and
So can you please tell me how to use $quiet so that I get return value
0 when port is not opened and my application does not exit.
Your suggestions are welcome.
Thanks in advance
- » need help with HTTP-WebTest module, tutorials or examples
- — Next thread in » PERL Modules Announcements
- » ssh on command line: force using a group size (prime size) of 1024 (and no...
- — The site's Newest Thread. Posted in » Secure Shell Forum