http://www.perlmonks.org?node_id=1203285


in reply to Re: Conditional use of Win32::TieRegistry
in thread Conditional use of Win32::TieRegistry

Works for Windows, fails on Linux:

Too few arguments to `use if' (some code returning an empty list in list context?) at /usr/lib/perl5/5.10.0/if.pm line 7.

Replies are listed 'Best First'.
Re^3: Conditional use of Win32::TieRegistry
by 1nickt (Abbot) on Nov 13, 2017 at 20:56 UTC

    Sorry, missed quoting the module (necessary if no args provided, like use if CONDITION, MODULE => ARGUMENTS;)

    Should be:

    use if $^O =~ 'MSWin32', 'Win32::TieRegistry';
    ... but I'm sure you saw that in the doc I linked to, right?


    The way forward always starts with a minimal test.