Perl problem - COM ports and filehandles
Mark Overmeer
mark at overmeer.net
Thu Feb 2 12:07:55 GMT 2012
* Darren Harwood (darren.harwood at pb.com) [120201 17:08]:
> i am trying to convert a perl script from *nix to win32.
> i am having difficulty with a couple of things:
>
> 1) the unix script opens a filehandle to a device like this:
> my ($nfound, $timeleft) = select($rin, undef, undef, $timeDelimiter_s);
> thoughts on equivalent code?
> my $ob = Win32::SerialPort->new ('COM8') || die;
The POSIX select() is supported under Windows, however... in its
minimal implementation: only network sockets... afaik.
See http://msdn.microsoft.com/en-us/library/ms740141%28v=vs.85%29.aspx
I expect the same is true for poll() (WSApoll on Windows)
And a COM port is not a socket, is it?
Even the UNIXes have different levels of support. They all support
pipes and devices, some do support file-io to be in there.
(warning: I never use Windows so this knowledge is only from
(outdated?) man-pages)
--
Regards,
MarkOv
------------------------------------------------------------------------
Mark Overmeer MSc MARKOV Solutions
Mark at Overmeer.net solutions at overmeer.net
http://Mark.Overmeer.net http://solutions.overmeer.net
More information about the london.pm
mailing list