There is a code:

use OpenGL sub glInit { glpOpenWindow(); glMatrixMode( GL_PROJECTION ); glFrustum(-1.0, 1.0, -1.0, 1.0, 1.0, 20.0); } glInit(); print "Press return to exit\n"; while ( <> ) { exit; } 

On the line glpOpenWindow(); gives an error message:

 Goto undefined subroutine &AutoLoader::AUTOLOAD at /Library/Perl/5.18/darwin-thread-multi-2level/OpenGL.pm line 6110. 

How can this be cured?

  • Judging by the current issue, you have found a solution for this.stackoverflow.com/questions/511330/… write it there. - edem
  • Show part of the code around line 6110 in this file /Library/Perl/5.18/darwin-thread-multi-2level/OpenGL.pm - edem
  • @edem $AutoLoader::AUTOLOAD = $AUTOLOAD; goto &AutoLoader::AUTOLOAD; - Nicholas Goncharov

1 answer 1

For a long time digging around the Internet, I did not find anything. In the very OpenGL.pm found a line on which everything falls:

 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 } 

By THIS AUTOLOAD FUNCTION IS FLAWED you can guess what the problem is in the module. So my decision was:

I hooked up Glut and used it to create a window. Everything is fine, OpenGL draws primitives.