的My_Module
- 模塊(在此包中使用)use
小號Signals::XSIG,並設置$XSIG{'WINCH'}[1] = sub { ... };
「規定」不工作,其中「使用」的作品
use warnings;
use 5.014;
package Auto_sid;
use Exporter 'import';
our @EXPORT = qw(something);
use My_Module;
no warnings qw(redefine);
sub My_Module::list_to_big {
my (@arguments) = @_;
require Signals::XSIG;
Signals::XSIG->import(%Signals::XSIG::XSIG);
@{$Signals::XSIG::XSIG{'WINCH'}} =();
no Signals::XSIG;
# ...
# do something that My_Module normaly doesn't do and
# which doesn't work when modified $SIG{'WINCH'}
# ...
}
當我使用這個,我得到了很多錯誤信息像:
"NUM63" is not exported by the Signals::XSIG module
"ARRAY(0xc23180)" is not exported by the Signals::XSIG module
"TRAP" is not exported by the Signals::XSIG module
"ARRAY(0xc119c8)" is not exported by the Signals::XSIG module
...
當我使用use
,而不是require
它工作正常。
爲什麼這不適用於require
?