in reply to How to strip off parts of the code according to environment

Use the 'if' pragma. The condition must be on something which is available at compile time, unless you place it in a BEGIN block, like an environment variable, Config setting, or Perl built-in variable, for example:
use if ($ENV{IN_APP_SERVER}), 'MyApp::SOAPClient::SAP'; use if ($^O ne 'MSWin32'), 'POSIX';
update: corrected Homerbug typo