|
Posted by Brian McCauley on September 8, 2007, 10:02 am
Please log in for more thread options
> Now I am trying to open a port which does not exist on my machine(e.g.
> COM3)
> 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.
> $PortObj = new Win32::SerialPort ($_[0], $quiet)
> || die "Can't open $_[0]: $^E\n"; # $quiet is optional
> 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
> application exits.
>
Doctor, doctor it hurts when I do this...
If you don't want your application to die when Win32::SerialPort->new
returns false then I would suggest you should remove the die() that is
executed when Win32::SerialPort->new returns false.
|