Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有下一个代码:
print for @{ $events->{ $name } };
什么时候$events是空散列我得到$name关键值是空数组[]
$events
$name
[]
尽管我只是访问元素并且没有分配任何东西,但为什么自动生存仍然有效?
分配不会自动激活;评估为左值,以便您可以分配。
Foreach 的列表表达式被评估为左值以允许$_ = 1 for @a;
$_ = 1 for @a;