Thread Bareword "SDL_QUIT" (9 answers)
Opened by defcon at 2007-09-07 21:48

defcon
 2007-09-07 21:48
#99201 #99201
User since
2007-07-14
11 Artikel
BenutzerIn

user image
Hallo zusammen,
ich wollte ein script ausprobieren, und bekomme beim ausführen folgende Meldungen:
Code: (dl )
1
2
3
Bareword "SDL_QUIT" not allowed while "strict subs" in use at ./skydive.pl line 102.
Bareword "SDL_KEYDOWN" not allowed while "strict subs" in use at ./skydive.pl line 104.
Execution of ./skydive.pl aborted due to compilation errors.


die entsprechende Passage sieht so aus:
Code (perl): (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
while ($event->poll != 0) {
      my $type = $event->type();
      exit if $type == SDL_QUIT;

if($type == SDL_KEYDOWN) {
        my $keypressed = $event->key_name;
  
        if($keypressed eq "left") {
            $obj->move("w", 0.1);
        } elsif($keypressed eq "right") {
            $obj->move("e", 0.1);
        } elsif($keypressed eq "up") {
          # deploy parachute
          $vterm = $VTERM_PARA;
          $obj->image($para);
        } elsif($keypressed eq "r") {
          $obj->wipe();
          next GAME;
        } elsif($keypressed eq "q") {
          exit 0; # quit
        }
      }
    }



Unter einer anderen Distribution funktionierts einwandfrei, nur unter debian nicht.. warum auch immer.

View full thread Bareword "SDL_QUIT"