@@ -8,18 +8,17 @@ package OpenGL::GLUT;
8
8
# This program is free software; you can redistribute it and/or
9
9
# modify it under the same terms as Perl itself.
10
10
11
+ use strict;
12
+ use warnings;
11
13
require Exporter;
12
14
require DynaLoader;
13
15
14
16
use Carp;
15
17
16
18
our $VERSION = ' 0.71_01' ;
17
- $XS_VERSION = $VERSION ;
18
- $VERSION = eval ($VERSION );
19
-
20
- @ISA = qw( Exporter AutoLoader DynaLoader) ;
21
-
22
- our $gl_version ;
19
+ our $XS_VERSION = $VERSION ;
20
+ our @ISA = qw( Exporter AutoLoader DynaLoader) ;
21
+ our ($gl_version , $AUTOLOAD );
23
22
our $glext_installed = {};
24
23
25
24
# Implemented extensions and their dependencies
@@ -108,8 +107,7 @@ our $glext_dependencies =
108
107
GL_SUN_slice_accum => ' 1.0' # 258
109
108
};
110
109
111
-
112
- @glut_func = qw(
110
+ my @glut_func = qw(
113
111
done_glutInit
114
112
glutAddMenuEntry
115
113
glutAddSubMenu
@@ -247,7 +245,7 @@ our $glext_dependencies =
247
245
# #
248
246
# #------------------------------------------------------------------------
249
247
250
- @glut_const = qw(
248
+ my @glut_const = qw(
251
249
GLUT_API_VERSION
252
250
GLUT_XLIB_IMPLEMENTATION
253
251
GLUT_RGB
@@ -407,15 +405,15 @@ our $glext_dependencies =
407
405
GLUT_GAME_MODE_DISPLAY_CHANGED
408
406
) ;
409
407
410
- @EXPORT = ();
408
+ our @EXPORT = ();
411
409
412
410
# Other items we are prepared to export if requested
413
- @EXPORT_OK = (@glut_func , @glut_const );
411
+ our @EXPORT_OK = (@glut_func , @glut_const );
414
412
415
- @constants = (@glut_const );
416
- @functions = (@glut_func );
413
+ my @constants = (@glut_const );
414
+ my @functions = (@glut_func );
417
415
418
- %EXPORT_TAGS = (' constants' => \@constants , ' functions' => \@functions , ' all' => \@EXPORT_OK ,
416
+ our %EXPORT_TAGS = (' constants' => \@constants , ' functions' => \@functions , ' all' => \@EXPORT_OK ,
419
417
' glutconstants' => \@glut_const , ' glutfunctions' => \@glut_func ,
420
418
);
421
419
@@ -428,22 +426,19 @@ sub AUTOLOAD {
428
426
# Avoid old-style ``&CONST'' usage. Either remove the ``&'' or add ``()''.
429
427
if (@_ > 0) {
430
428
# Is it an old OpenGL-0.4 function? If so, remap it to newer variant
431
- local ($constname );
432
- ($constname = $AUTOLOAD ) =~ s / .*::// ;
433
-
429
+ (my $constname = $AUTOLOAD ) =~ s / .*::// ;
434
430
$AutoLoader::AUTOLOAD = $AUTOLOAD ;
435
431
goto &AutoLoader::AUTOLOAD;
436
432
}
437
- local ($constname );
438
- ($constname = $AUTOLOAD ) =~ s / .*::// ;
439
- $val = constant($constname , @_ ? $_ [0] : 0);
433
+ (my $constname = $AUTOLOAD ) =~ s / .*::// ;
434
+ my $val = constant($constname , @_ ? $_ [0] : 0);
440
435
if (not defined $val ) {
441
436
if ($! =~ / Invalid/ ) {
442
437
$AutoLoader::AUTOLOAD = $AUTOLOAD ;
443
438
goto &AutoLoader::AUTOLOAD;
444
439
}
445
440
else {
446
- ($pack ,$file ,$line ) = caller ;
441
+ my ($pack ,$file ,$line ) = caller ;
447
442
die " Your vendor has not defined OpenGL macro $constname , used at $file line $line .
448
443
" ;
449
444
}
0 commit comments