Re: use modules OS dependent



Gunnar Hjalmarsson wrote:
sledz@xxxxxxxxxxxx wrote:
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:


<snip>

if ( $^O eq 'MSWin32' ) {

I prefer if ( $^O =~ /Win32/i ) {

--
Petr Vileta, Czech republic
(My server rejects all messages from Yahoo and Hotmail. Send me your
mail from another non-spammer site please.)

Please reply to <petr AT practisoft DOT cz>

.



Relevant Pages

  • Re: use modules OS dependent
    ... port. ... The script should be able to run in Linux and Win32 ... In both environments exist modules to access the serial ...
    (comp.lang.perl.modules)
  • Re: use modules OS dependent
    ... port. ... The script should be able to run in Linux and Win32 ... In both environments exist modules to access the serial ... seems not possible to use different modules depending on this ...
    (comp.lang.perl.modules)
  • Re: port and managing of IIS
    ... Normally, i have 3 environments (development, test and ... production) on 3 differents servers. ... >>Is it save to create web site on other port than 80? ... >>does a list of port number exist to use with iis. ...
    (microsoft.public.inetserver.iis.security)
  • Re: Porting application from old Smalltalk Version
    ... we are in your same situation and we had tested some environments to port. ... The part that involves more time/work to port is the GUI and there aren´t Smalltalks with exactly the same GUI framework. ... > Wich version is closest to class structure to VisualSmalltalk R3.1? ...
    (comp.lang.smalltalk)
  • use modules OS dependent
    ... I'm writing an perl script which should communicate over a serial ... port. ... In both environments exist modules to access the serial ... seems not possible to use different modules depending on this ...
    (comp.lang.perl.modules)