I have a module misc
with variable $verbose
:
use strict;
use diagnostics;
package misc;
my $verbose = 1;
and module mymod
which uses misc
:
use strict;
use diagnostics;
use misc;
package mymod;
sub mysub ($) {
...
($misc::verbose > 0) and print "verbose!\n";
}
which is, in turn, used by myprog
:
use strict;
use diagnostics;
use misc;
use mymod;
mymod::mysub("foo");
when I execute myprog
, I get this warning:
Use of uninitialized value $misc::verbose in numeric gt (>) at mymod.pm line ...
what am I doing wrong?