|
|
| Think about Loose Coupling | |
| PerlMonks |
Conditionally faking a moduleby wanna_code_perl (Monk) |
| on Jan 13, 2010 at 18:23 UTC ( #817249=perlquestion: print w/ replies, xml ) | Need Help?? |
|
wanna_code_perl has asked for the
wisdom of the Perl Monks concerning the following question:
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:
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?
Back to
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||||||||||||||||