in reply to use conditional

You are missing the (fat) comma:

use if $VersionOS eq 'Win', Win32::OLE => 'CP_UTF8';

From the documentation for if the syntax seems clear.

Replies are listed 'Best First'.
Re^2: use conditional
by haukex (Archbishop) on Dec 12, 2019 at 20:19 UTC
    use if $VersionOS eq 'Win', Win32::OLE => 'CP_UTF8';

    Note that this doesn't work under strict because Bareword "Win32::OLE" not allowed while "strict subs" in use; the :: prevents the LHS of the fat comma being autoquoted. So:

    use if $VersionOS eq 'Win', 'Win32::OLE' => 'CP_UTF8'; # or use if $VersionOS eq 'Win', 'Win32::OLE', 'CP_UTF8';
Re^2: use conditional
by Takamoto (Monk) on Dec 12, 2019 at 20:53 UTC
    Thank you!