in reply to Include a package based on OS.
I search using your keywords
on perlmonks only [based on os] based on os -> Splitting an extension based on OS
use if ($^O eq "MSWin32"), 'Win32::Process'; use if ($^O eq "MSWin32"), 'Win32::SearchPath'; use if ($^O ne "MSWin32"), 'POSIX';
using DuckDuckGo [ddg://site:perlmonks.org Include a package based on OS.] site:perlmonks.org Include a package based on OS. -> How can I include a module for Windows only??
Using Google [google://site:perlmonks.org Include a package based on OS.] site:perlmonks.org Include a package based on OS. -> How can I include a module for Windows only??, including modules during runtime and dealing with OS specific (constants) code block, Splitting an extension based on OS
My memory Re: How do you use the if pragma? , Re^5: Problems with forking, Re^3: Loading a module at runtime, Re: mention a non-installed module in script, Re: constants wont optimize, Re^3: How to have OS specific code sections in Perl, Re: Variable as module name? (modern perl), Re^2: Redefining Imported Subs: of scope and no, use Module::Implementation
use Perl::OSType qw' is_os_type '; use if is_os_type('Windows'), qw' Win32::SerialPort '; use if not is_os_type('Windows'), qw' Device::SerialPort ';
ssearch , its for everybody
|
|---|