in reply to conditionally include a module

As well as the require method already mentioned, there's also a standard module for this, if:
use if ($^O eq 'MSWin32'), 'Win32::OLE';

Replies are listed 'Best First'.
Re^2: conditionally include a module
by sgt (Deacon) on Aug 23, 2007 at 09:50 UTC

    standard strictly above 5.6.1

    % steph@apexPDell2 (/home/stephan) % % perl -MModule::CoreList -e 'print Module::CoreList->first_release(q[ +if])' 5.006002
    cheers --stephan
      Standard strictly above 5.7.2 *and* in 5.6.2 :-)
      $ corelist -a if if was first released with perl 5.006002 5.006002 0.03 5.007003 0.01 5.008 0.01 5.008001 0.03 5.008002 0.03 5.008003 0.03 5.008004 0.03 5.008005 0.03 5.008006 0.03 5.008007 0.03 5.008008 0.05 5.009 0.03 5.009001 0.0401 5.009002 0.0401 5.009003 0.05 5.009004 0.05 5.009005 0.05
      Also note that "if was first released with perl 5.006002" is incorrect - it was first released with perl 5.7.3 in March 2002. 5.6.2 was released in November 2003.