Fixes for Font in strict
Kartik Thakore [Sat, 15 Aug 2009 18:41:43 +0000 (14:41 -0400)]
lib/SDL.pm
lib/SDL/Tool/Font.pm

index 6d2a4b4..7a7d346 100644 (file)
@@ -60,7 +60,8 @@ sub NULL {
 
 sub in {
        my ($k,@t) = @_;
-       (scalar grep { defined $_ && $_ eq $k } @t) <=> 0;
+       return 0 unless defined $k;
+       return $k ~~ @t;
 } 
 
 sub verify (\%@) {
index f22be01..b66267f 100644 (file)
@@ -58,7 +58,9 @@ sub new {
                                        -bg => $option{-background} || $option{-bg};
                for (qw/ normal bold italic underline / ) {
                        if ($option{"-$_"}) {
-                               &{"SDL::TTFont::$_"}($$self{-font});
+                               
+                               SDL::TTFont->can($_)->($$self{-font});
+                               #&{$sub}($$self{-font});
                        }
                }
        } else {