hennesse has asked for the wisdom of the Perl Monks concerning the following question:
I'm porting my freeBSD code to Win32 and need to use a different ::SerialPort module depending on the platform
This doesn't work...
$platform = "win32"; # I really test $^O
if ($platform eq "win32") {
use Win32::SerialPort;
} else {
use Device::SerialPort;
}
Perl looks for both of them and fails with a "can't find".
What's the right way to do this?
Thanks, Dave
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: conditional USE MODULE
by BrowserUk (Patriarch) on Oct 18, 2011 at 04:40 UTC | |
|
Re: conditional USE MODULE
by ikegami (Patriarch) on Oct 18, 2011 at 06:26 UTC | |
|
Re: conditional USE MODULE
by Khen1950fx (Canon) on Oct 18, 2011 at 03:29 UTC | |
|
Re: conditional USE MODULE
by hennesse (Beadle) on Oct 18, 2011 at 13:29 UTC | |
|
Re: conditional USE MODULE
by Anonymous Monk on Oct 18, 2011 at 08:38 UTC |