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.
my %dd; $dd["foo"]="bar"; print keys %dd; print %dd;
这是我的代码。这应该%dd在最后两行显示字典的键和字典本身,对吗?但事实并非如此!几个小时以来,我一直在为此烦恼,但没有任何帮助。
%dd
正确的语法是:
my %dd; $dd{"foo"}="bar"; print keys %dd; print %dd;
注意:它是“{}”而不是“[]”