Perl problem - COM ports and filehandles
ash+perl at best-scarper.co.uk
Thu Feb 2 13:07:51 GMT 2012
> Message: 1
> Date: Wed, 1 Feb 2012 11:59:17 -0500
> From: Darren Harwood <darren.harwood at pb.com>
> Subject: Perl problem - COM ports and filehandles
> To: "london.pm at london.pm.org" <london.pm at london.pm.org>
> <1FFEF92EDF70F14D992F400F4C6F70D8B5969B4297 at PBI-NAMSG-03.MGDPBI.global.pvt
> Content-Type: text/plain; charset="us-ascii"
> good afternoon all,
> 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:
> open my $pipe, '+<', '/dev/ttyUSB0' or die "Couldn't open pipe for reading
> and writing";
> my $mb = myDevice::myObject->new($pipe);
I am not an expert in serial comms, but this looks like Unix systems
programming in Perl, which makes it inherently less portable.
There are USB abstractions in CPAN (Device::USB). See www.libusb.org.
If you can port your code to the abstraction in Unix *first*, maybe it will
be less painful to port to Win32.
More information about the london.pm