我希望nstore
一个 Perl 哈希值,其中还包含代码引用。按照此perldoc http://perldoc.perl.org/Storable.html#CODE-REFERENCEShttp://perldoc.perl.org/Storable.html#CODE-REFERENCES我写了这样的东西:
use strict;
use warnings;
local $Storable::Deparse = 1;
my %hash = (... CODE => ...);
nstore (\%hash, $file);
我收到警告说Name "Storable::Deparse" used only once: possible typo at test4.pl line 15.
。我想我可以专门抑制这个警告,但这让我想知道我是否做错了什么。
注意这个问题与此相关one https://stackoverflow.com/questions/3845183。用不同的标题来区分两者将是最受欢迎的。
在设置其配置值之一之前,您忽略了加载可存储模块。
use strict;
use warnings;
use Storable qw(nstore);
local $Storable::Deparse = 1;
my %hash = (... CODE => ...);
nstore (\%hash, $file);
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)