in reply to How to know the Windows OS that perl is running on

Do you happen to have the luxury of using an installer to set up your application at each customer site?   The reason why I make that suggestion is that, if you do, then perhaps your problem has just become very easy.   Even though the situation may vary from one customer to the next, the appropriate choice will be made for you at installation time (and stored, say, in a registry-key that you require must exist).