in reply to main and external script
And the main script that exploits the configuration information:package Testing; use strict; use Exporter; our @ISA = qw(Exporter); our (%EXPORT_TAGS); $EXPORT_TAGS{'config'} = [qw($verbose $debug)]; Exporter::export_ok_tags('config'); our ($verbose, $debug) = (1,1); 1;
When the code directly above is run, it produces, as expected:use strict; use warnings; use Testing qw(:config); print "I am ", $verbose ? "" : "not ", "verbose\n"; print "I should ", $debug ? "" : "not ", "debug\n";
For instance, if we changed this line ( our ($verbose, $debug) = (1,1); ) in the configuration module, to ( our ($verbose, $debug) = (undef,undef); ) we would get:I am verbose I should debug
I am not verbose I should not debug
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: main and external script
by gu (Beadle) on Dec 02, 2005 at 19:19 UTC |