|
Prev: FAQ 9.11 How do I redirect to another page?
Next: Can someone 'splain why this regex won't work both ways?
From: sledz on 14 Apr 2008 09:24 I'm writing an perl script which should communicate over a serial port. The script should be able to run in Linux and Win32 environments. In both environments exist modules to access the serial port: Win32::SerialPort (under Windows) Device::SerialPort (else) I know it is possible to detect the OS using Config::Config. But it seems not possible to use different modules depending on this information like this: if ( $OS eq 'WINDOWS' ) { use Win32::SerialPort qw( :PARAM :STAT ); } else { use Device::SerialPort qw( :PARAM :STAT ); } What's the right way to write such an OS dependent application? Steffen PS: Fup to comp.lang.perl.modules
From: Gunnar Hjalmarsson on 14 Apr 2008 09:26
sledz(a)dresearch.de wrote: > I'm writing an perl ... I just answered your question in clpmodules. Please show some patience. -- Gunnar Hjalmarsson Email: http://www.gunnar.cc/cgi-bin/contact.pl |