in reply to OS-dependent dependencies

I currently use Module::Build with a traditional Makefile.PL generated

I don't think you're going to be able to get this to work while automatically generating a traditional Makefile.PL with Module::Build. You'll need both your Build.PL and Makefile.PL to have the OS-specific dependencies.

Another possibility is try Module::Install and you put the OS-specific dependency logic there and let it generate your Build.PL and/or Makefile.PL... but that is just another wrapper around the problem. For example, from the Pod, an example from File::HomeDir:

use inc::Module::Install; name 'File-HomeDir'; all_from 'lib/File/HomeDir.pm'; requires 'File::Spec' => '0.80'; build_requires 'Test::More' => '0.47'; if ( $MacPerl::Version ) { # Needed on legacy Mac OS 9 requires 'Mac::Files' => 0; } if ( $^O eq 'MXWin32' ) { # Needed on Windows platforms requires 'Win32::TieRegistry' => 0; } auto_install; WriteAll;

-xdg

Code written by xdg and posted on PerlMonks is public domain. It is provided as is with no warranties, express or implied, of any kind. Posted code may not have been tested. Use of posted code is at your own risk.