Jun 3, 2011, 12:43 PM
Post #1 of 5
OS Specific 'use' statement
I have the following OS portability problem.
I want to 'use' a perl module in my code only if it is running under Windows. The module will not be available on Linux. But my code has to run on both Windows and Linux and I want the same code base to run on them.
In short I am looking for something like..
#if (OS is windows)
Now statements like if($OSNAME eq 'Windows') does not work on this as I can not put the 'use' statement inside a regular 'if' condition.
If someone can think of a solution, can you please help me with this?