in reply to Using Pre-processor directive in Perl

I just want to add that there's a fundamental difference between C and Perl that makes "code disabling" preprocessor directives in Perl unnecessary.

C is a compiled language, and preprocessor is for the *compiler*. What's #ifdef-ed out won't show up in the compiled code at all. This can boost performance and reduce the executable file size especially for multiplatform apps.

Perl is not compiled, at least not in the sense C is, so it doesn't need such complications. A simple if (0) is good enough to exclude code from running. No preprocessor directive will make your code smaller to carry aroung.

  • Comment on Re: Using Pre-processor directive in Perl