我被要求修改一些现有代码以添加一些附加功能。我在Google上搜索过,似乎找不到答案。我有这样的事情…
%first_hash = gen_first_hash(); %second_hash = gen_second_hash(); do_stuff_with_hashes(%first_hash,%second_hash); sub do_stuff_with_hashes { my %first_hash = shift; my %second_hash = shift; # do stuff with the hashes }
我收到以下错误:
Odd number of elements in hash assignment at ./gen.pl line 85. Odd number of elements in hash assignment at ./gen.pl line 86. Use of uninitialized value in concatenation (.) or string at ./gen.pl line 124. Use of uninitialized value in concatenation (.) or string at ./gen.pl line 143.
第85行和第86行是子程序中的前两行,124和143是我访问哈希的位置。当我查看这些错误时,似乎表明我的哈希值未初始化。但是,我可以验证散列值是否具有值。为什么我得到这些错误?
解决方法
原文地址:https://www.jb51.cc/Perl/173188.html
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。