From: Kartik Thakore Date: Sat, 15 Aug 2009 18:41:43 +0000 (-0400) Subject: Fixes for Font in strict X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=1cf7cae796a5b208ea570efa73bc8ad2acf4f42a;p=sdlgit%2FSDL_perl.git Fixes for Font in strict --- diff --git a/lib/SDL.pm b/lib/SDL.pm index 6d2a4b4..7a7d346 100644 --- a/lib/SDL.pm +++ b/lib/SDL.pm @@ -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 (\%@) { diff --git a/lib/SDL/Tool/Font.pm b/lib/SDL/Tool/Font.pm index f22be01..b66267f 100644 --- a/lib/SDL/Tool/Font.pm +++ b/lib/SDL/Tool/Font.pm @@ -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 {