小编dav*_*ave的帖子

如何在Perl中引用特定的哈希值?

如何在特定哈希键中创建对值的引用.我尝试了以下但是$$ foo是空的.任何帮助深表感谢.

$hash->{1} = "one";
$hash->{2} = "two";
$hash->{3} = "three";

$foo = \${$hash->{1}};
$hash->{1} = "ONE";

#I want "MONEY: ONE";
print "MONEY: $$foo\n";
Run Code Online (Sandbox Code Playgroud)

perl hash reference dereference

5
推荐指数
2
解决办法
4263
查看次数

标签 统计

dereference ×1

hash ×1

perl ×1

reference ×1