use OpenGL;
use SDL;
glpOpenWindow();
print "Return to exit\n";
while(<>){
exit;
}
结果是 在C:/strawberry/perl/site/lib/OpenGL.pm第6110行转到未定义的子程序&AutoLoader :: AUTOLOAD。
我尝试了OpenGL的test.pl。非常好用,但这行我很奇怪!
答案 0 :(得分:0)
以下是来自OpenGL.pm
的方法AUTOLOAD
的源代码
sub AUTOLOAD {
# This AUTOLOAD is used to 'autoload' constants from the constant()
# XS function. If a constant is not found then control is passed
# to the AUTOLOAD in AutoLoader.
# NOTE: THIS AUTOLOAD FUNCTION IS FLAWED (but is the best we can do for now).
# Avoid old-style ``&CONST'' usage. Either remove the ``&'' or add ``()''.
if (@_ > 0) {
# Is it an old OpenGL-0.4 function? If so, remap it to newer variant
local($constname);
($constname = $AUTOLOAD) =~ s/.*:://;
if (grep ($_ eq $constname, @rename_old)) {
eval "sub $AUTOLOAD { $AUTOLOAD" . "_s(\@_) }";
goto &$AUTOLOAD;
}
$AutoLoader::AUTOLOAD = $AUTOLOAD;
goto &AutoLoader::AUTOLOAD; #LINE 6110
}
他们发表评论THIS AUTOLOAD FUNCTION IS FLAWED
因此,您所获得的警告可能不是由于您的程序,而是模块本身的问题。