in reply to Re^2: Easing cross-platform scripting
in thread Easing cross-platform scripting

One arguably more elegant way would be with the if pragma. The documentation even uses this specific case (yes/no MSWin32) as the first example.

Another could be Module::Load which can be used for run-time decisions (as opposed to compile-time) and might therefore be better suited to more general cases.

  • Comment on Re^3: Easing cross-platform scripting (conditional module loading)