in reply to require Win32::Process, barewords "THREAD_PRIORITY_BELOW_NORMAL" not allowed?

The problem is that you are using require, which is executed at run-time. That means "THREAD_PRIORITY_BELOW_NORMAL" will not be known at compile-time, hence the error.

I think I see why you are using require, because you want a conditional module use. I suggest you use (pun) the if pragma. For example, here is some code from one of my modules which runs under Linux and Windoze:
use if ($^O eq "MSWin32"), 'Win32::Process'; use if ($^O eq "MSWin32"), 'Win32::SearchPath'; use if ($^O ne "MSWin32"), 'POSIX'; use if ($^O ne "MSWin32"), 'POSIX' => ':sys_wait_h'; # Hack to allow compilation under Unix # (NORMAL_PRIORITY_CLASS and INFINITE are Win32 only) use if ($^O ne "MSWin32"), 'constant' => 'NORMAL_PRIORITY_CLASS'; use if ($^O ne "MSWin32"), 'constant' => 'INFINITE';
The constants (similar to that you need) have to be defined for non-Windows platforms. They need no value, they are there to keep the compiler happy.
  • Comment on Re: require Win32::Process, barewords "THREAD_PRIORITY_BELOW_NORMAL" not allowed?
  • Download Code