in reply to Accessing Serial port on windows and Linux
Win32::SerialPort for Win32 and Device::SerialPort for linux. Common interface.
my $PortObj; if ( $^O =~ m/Win32/ ) { require Win32::SerialPort; $PortObj = new Win32::SerialPort ($PortName, $quiet, $lockfile) or die "Can't open $PortName: $!\n"; } else { require Device::SerialPort; $PortObj = new Device::SerialPort ($PortName, $quiet, $lockfile) or die "Can't open $PortName: $!\n"; } # theoretically do same stuff on Win32 or Linux with same method calls
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Accessing Serial port on windows and Linux
by kranthi (Sexton) on May 27, 2008 at 07:45 UTC | |
by tachyon-II (Chaplain) on May 27, 2008 at 12:30 UTC |
In Section
Seekers of Perl Wisdom