Hello monks,
I've built an application which is designed to run both normally on Linux, or packaged up on Win32 with Cava Packer. Cava Packer comes with Cava::Pack, which I need to fake out, because as far as I can tell, there is no equivalent module for Linux.
I've worked around this with the following code:
BEGIN { package Cava::Pack; sub Resource { $Cava::Pack::dir.'/'.$_[0]; } sub SetResourcePath { $Cava::Pack::dir = $_[0]; } sub GetInfoProductVersion { "0.9.9.0"; } }
This works fine in Linux, but in Windows I need to use the real Cava::Pack, and if I add a use Cava::Pack; line, I get function redefinition warnings (not to mention compilation fails on Linux because there is no Cava/Pack.pm in my @INC.
What I need to do is conditionally use the real Cava::Pack if it is available, or run my above code if it is not available. How do I go about that?
In reply to Conditionally faking a module by wanna_code_perl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |