Reputation: 21
I've a perl module which needs to run within both Win32 and Linux OSes. This module employs Win32::Process::List to avoid concurrency issues with a 3rd party application under Win32, and has no equivalent requirement when run under Linux.
So far, I've managed to have two copies of the same module, with Win32-specific stuff commented out for the Linux version - and I'm obviously not happy with this error-prone approach.
It is clear that win-specific stuff does not "make install" in Linux. I've tried a softer approach in my code with require Win32::Process::List;
instead of use Win32::Process::List;
, the former giving the advantage of passing perl -c mymodule
- however still failing in regular use.
Thus my question: apart from mantaining two distinct code bases, is there a more robust way to approach such situations?
Upvotes: 2
Views: 1180