How to 'conditionally' use a specified module
- From: "danny" <dannymiles2@xxxxxxxxx>
- Date: 15 Nov 2006 16:00:26 -0800
Hello everyone,
I need to check if one of my variables is true, then use a specific
module:
my $use_cache = 'no';
if ($use_cache == 'yes'){
use Cache::SizeAwareFileCache;
}
The problem I have is that no matter if $use_cache is yes or no, Perl
always try to evaluate the use of Cache::SizeAwareFileCache at run-time
and if I don't have that module installed, it gives me an error:
Couldn't find the module "Cache/SizeAwareFileCache.pm".
Even though I stated clearly that $use_cache = 'no', Perl still reports
that Cache::SizeAwareFileCache is not installed.
What exactly am I missing here? Is there an easy way to ignore the
missing module inside a condition?
Thanks
--Danny
.
- Follow-Ups:
- Re: How to 'conditionally' use a specified module
- From: usenet
- Re: How to 'conditionally' use a specified module
- Prev by Date: Re: How to manipulate environment variables in parent process?
- Next by Date: Re: How to 'conditionally' use a specified module
- Previous by thread: Parse Blog data
- Next by thread: Re: How to 'conditionally' use a specified module
- Index(es):
Relevant Pages
|