Perl:不推荐使用哈希作为参考 [英] Perl: Using a hash as a reference is deprecated

查看:46
本文介绍了Perl:不推荐使用哈希作为参考的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发脚本,即重用一些非常旧的 perl 代码.

I'm developing script, that is reusing some really old piece of perl code.

这一行仍然给我错误使用哈希作为参考已被弃用.

This line gives me still the error Using a hash as a reference is deprecated .

  %hash->{$_[$counter]} = $_[$counter+1];

我必须如何重构这段代码,以便我不会收到错误.

How I have to refactor this code, so that I will be not receiving the error.

推荐答案

尝试

$hash{$_[$counter]} = $_[$counter+1];

这篇关于Perl:不推荐使用哈希作为参考的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆