Click here to get back home

use modules OS dependent

 HomeNewsGroups | Search | About
 comp.lang.perl.misc    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
use modules OS dependent sledz 04-14-2008
Posted by sledz on April 14, 2008, 9:24 am
Please log in for more thread options
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

Posted by Gunnar Hjalmarsson on April 14, 2008, 9:26 am
Please log in for more thread options
sledz@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

Similar ThreadsPosted
installing architecture dependent modules March 2, 2005, 8:17 pm
Dependent modules and version control May 29, 2008, 8:50 am
Re: browser-dependent cookie behavior September 1, 2006, 9:44 am
Re: browser-dependent cookie behavior September 1, 2006, 10:38 pm
perl -V in 5.8.8 doesn't add architecture dependent directories? December 30, 2006, 10:47 am
browser-dependent cookie behavior September 1, 2006, 8:25 am
modules, modules, modules November 26, 2005, 3:33 am
Using CGI and GD modules December 2, 2005, 12:46 pm
Modules using each other January 31, 2006, 4:50 pm
Modules February 15, 2006, 3:47 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap