in reply to How to do a conditional load of a module ?

Damn, spoke too soon. The "if use..." syntax does bypass the Windows module load when running on Unix, but now the load fails on Windows. Oy! The two loads that are causing me a problem both have arguements.
use if ($^O eq "MSWin32"), "Win32API::Registry '(:ALL)'"; use if ($^O eq "MSWin32"), "Win32::TieRegistry ( Delimiter=>\"/\" )";
I've tried all the syntax variations I can think of. Does anyone know what I'm missing ?
Thanks, Dave

Replies are listed 'Best First'.
Re^2: How to do a conditional load of a module ?
by rev_1318 (Chaplain) on Jul 19, 2005 at 09:03 UTC
    Did you check the documentation of if?
    SYNOPSIS use if CONDITION, MODULE => ARGUMENTS;
    So it should be something like:
    use if $^O eq "MSWin32", Win32API::Registry => qw(:ALL);
    HTH

    Paul