尝试使用NetAddr::IP::Compact
函数
my $var = new NetAddr::IP '127.0.0.1/8';
print Dumper $var;
此处的输出是:
$VAR1 = bless({
'addr' => '',
'isv6' => 0,
'mask' => '?????????????'
}, 'NetAddr::IP');
我的问题是为什么我没有在这里看到addr和mask字段?
Use of uninitialized value in sort at blib/lib/NetAddr/IP.pm (autosplit into blib/lib/auto/NetAddr/IP/compactref.al) line 737.
答案 0 :(得分:1)
因为Data :: Dumper的默认设置很糟糕。
{
local $Data::Dumper::Useqq = 1;
print Dumper $var;
}