in reply to Re: require different modules per OS?
in thread require different modules per OS?

I have an os check for this method call

You'd have to avoid that the code is even being compiled (as opposed to not being run only), for example by (again) making use of string-eval:

use strict; eval 'printf "%d\n", DETACHED_PROCESS;' if $^O =~ /win32/i; # ok printf "%d\n", DETACHED_PROCESS if $^O =~ /win32/i; # not o +k: Bareword "DETACHED_PROCESS" not allowed...