我有一个misc
带有变量的模块$verbose
:
use strict;
use diagnostics;
package misc;
my $verbose = 1;
和mymod
使用的模块misc
:
use strict;
use diagnostics;
use misc;
package mymod;
sub mysub ($) {
...
($misc::verbose > 0) and print "verbose!\n";
}
这反过来又被myprog
:
use strict;
use diagnostics;
use misc;
use mymod;
mymod::mysub("foo");
当我执行时myprog
,我收到此警告:
Use of uninitialized value $misc::verbose in numeric gt (>) at mymod.pm line ...
我究竟做错了什么?