I search using your keywords

on perlmonks only  [based on os] based on os -> Splitting an extension based on OS

if , Devel::CheckOS

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

Perl::OSType

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


In reply to Re: Include a package based on OS (ssearch) by Anonymous Monk
in thread Include a package based on OS. by techman2006

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.