Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > use modules OS dependent

Reply
Thread Tools

use modules OS dependent

 
 
sledz@dresearch.de
Guest
Posts: n/a
 
      04-14-2008
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( ARAM :STAT );
} else {
use Device::SerialPort qw( ARAM :STAT );
}

What's the right way to write such an OS dependent application?

Steffen

PS: Fup to comp.lang.perl.modules
 
Reply With Quote
 
 
 
 
Gunnar Hjalmarsson
Guest
Posts: n/a
 
      04-14-2008
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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
make dependent assembly to use a different version Abubakar ASP .Net 3 08-17-2009 03:46 PM
non-dependent vs. dependent template names puzzlecracker C++ 1 08-07-2008 07:42 AM
installing architecture dependent modules Brandon Metcalf Perl Misc 0 03-02-2005 07:17 PM
imputils - import problem modules from sys.modules Remy Cool Python 1 08-27-2003 02:25 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57