in reply to conditional USE MODULE
Some possibilities:
use if $^O eq 'MSWin32', 'Win32::SerialPort'; use if $^O ne 'MSWin32', 'Device::SerialPort';
use if 1, $^O eq 'MSWin32 ? 'Win32::SerialPort' : 'Device::SerialPort';
BEGIN { eval( $^O eq 'MSWin32 ? 'use Win32::SerialPort; 1' : 'use Device::SerialPort; 1' ) or die $@; }
|
|---|