“无法调用方法"“get"是什么意思?在 " 处的未定义值上吝啬的? [英] What does "Can't call method "get" on an undefined value at " mean?

查看:29
本文介绍了“无法调用方法"“get"是什么意思?在 " 处的未定义值上吝啬的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在执行一个 Perl 文件.我收到此错误.任何人都可以请提出解决方案.我在许多页面上都遇到这种错误,例如:

I am executing a Perl file. I am getting this error. Can anybody please suggest the solution. I am getting this kind of error on many pages like:

无法对.."处的未定义值调用方法goto"

"Can't call method "goto" on an undefined value at " ..

仅仅通过替换get方法名来表示错误是一样的.

Means error is same just by replacing get method name.

请帮忙.

推荐答案

表示调用 get 方法的变量是未定义的,而不是接受该方法的对象.

It means the variable on which the method get is called is undefined instead of being an object that accepts the method.

查看错误信息给出的行号(在信息给出的文件中).如果错误发生在模块中,并且您没有看到变量应该在哪里初始化,那么在 use strict; 之后将 use diagnostics; 放在脚本的顶部code> 和 use warnings; 以便您在错误点获得方法/函数调用的堆栈.

Look at the line number given by the error message (in the file given by the message). If the error is in a module, and you don't see where the variable should have been initialized, then put use diagnostics; at the top of the script after your use strict; and use warnings; so you get a stack of the method/function calls at the point of error.

这篇关于“无法调用方法"“get"是什么意思?在 " 处的未定义值上吝啬的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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