in reply to Load module conditionally and export variables

As documented in if, what comes after the use if is a list (like any other import list). Try e.g. use if $VersionOS eq 'Win', 'Win32::OLE::Const', qw(Microsoft.Word);

Replies are listed 'Best First'.
Re^2: Load module conditionally and export variables
by Anonymous Monk on Jan 29, 2019 at 15:20 UTC

    Ohh, that easy. Thank you very much!