Re: Disable functionality thru commenting out a use
- From: "Mumia W. (on aioe)" <paduille.4060.mumia.w@xxxxxxxxxxxxx>
- Date: Sun, 31 Dec 2006 00:27:03 -0600
On 12/30/2006 08:49 AM, Robert Nicholson wrote:
I want to disable some functionality by making it conditional that it's
use statement is in the script.
How in general can you tell if a module is present or loaded? if
defined(X) what should X be?
I want to disable some features in a big perl script by
conditionalizing the code that relies on those modules and be able to
disable those features by comment out the "use" line for the modules.
Here's one way:
use Data::Dumper;
my @watergate = qw(Haldeman Nixon Colson Dean);
if ($INC{'Data/Dumper.pm'}) {
print Dumper(\@watergate);
}
--
paduille.4060.mumia.w@xxxxxxxxxxxxx
Windows Vista and your freedom in conflict:
http://www.badvista.org/
.
- References:
- Disable functionality thru commenting out a use
- From: Robert Nicholson
- Disable functionality thru commenting out a use
- Prev by Date: FAQ 4.46 How do I handle linked lists?
- Next by Date: Re: Problem by pushing a String and a Hash on an array!
- Previous by thread: Disable functionality thru commenting out a use
- Next by thread: perl -V in 5.8.8 doesn't add architecture dependent directories?
- Index(es):
Relevant Pages
|