XS for redtable done for set_gamma_ramp
[sdlgit/SDL_perl.git] / lib / SDL / Timer.pm
index 9f24d85..eea0f27 100644 (file)
@@ -31,6 +31,8 @@
 package SDL::Timer;
 
 use strict;
+use warnings;
+use Carp;
 use SDL;
 
 sub new {
@@ -42,7 +44,7 @@ sub new {
 
        verify(%options,qw/ -delay -times -d -t /);
 
-       die "SDL::Timer::new no delay specified\n"
+       croak "SDL::Timer::new no delay specified\n"
                unless ($options{-delay});
        $$self{-delay} = $options{-delay} || $options{-d} || 0;
        $$self{-times} = $options{-times} || $options{-t} || 0;
@@ -52,7 +54,7 @@ sub new {
                $$self{-routine} = sub { &$func; $$self{-delay}};
        }
        $$self{-timer} = SDL::NewTimer($$self{-delay},$$self{-routine});
-       die "Could not create timer, ", SDL::GetError(), "\n"
+       croak "Could not create timer, ", SDL::GetError(), "\n"
                unless ($self->{-timer});
        bless $self,$class;
        return $self;