From: Kartik Thakore Date: Tue, 1 Sep 2009 09:59:20 +0000 (-0400) Subject: Made new X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=275f555f7b7297d93d0d9b83266348d62e06cb85;p=sdlgit%2FSDL_perl.git Made new --- diff --git a/exp/SDL/Rect/lib/SDL/Rect.pm b/exp/SDL/Rect/lib/SDL/Rect.pm index c17ba67..77cd108 100644 --- a/exp/SDL/Rect/lib/SDL/Rect.pm +++ b/exp/SDL/Rect/lib/SDL/Rect.pm @@ -2,12 +2,11 @@ package SDL::Rect; use strict; - use vars qw($VERSION @ISA @EXPORT); + use vars qw($VERSION @ISA); $VERSION = '0.01'; - require Exporter; require DynaLoader; - @ISA = qw(Exporter DynaLoader); - @EXPORT = qw(NewRect RectX RectY RectW RectH); + @ISA = qw(DynaLoader); + @@ -30,7 +29,14 @@ See Also : #################### subroutine header end #################### +sub new +{ + my $self = shift; + my ($x, $y, $w, $h) = @_; + $self = \SDL::Rect::NewRect($x, $y, $w, $h); + return $self; +} #################### main pod documentation begin ################### ## Below is the stub of documentation for your module. @@ -93,8 +99,7 @@ perl(1). #################### main pod documentation end ################### -bootstrap SDL::Rect $VERSION; - +bootstrap SDL::Rect; 1; # The preceding line will help the module return a true value diff --git a/exp/SDL/Rect/t/001_load.t b/exp/SDL/Rect/t/001_load.t index 97398c0..f662373 100644 --- a/exp/SDL/Rect/t/001_load.t +++ b/exp/SDL/Rect/t/001_load.t @@ -1,12 +1,13 @@ # -*- perl -*- # t/001_load.t - check module loading and create testing directory +no AutoLoader; use Test::More tests => 2; BEGIN { use_ok( 'SDL::Rect' ); } -my $object = SDL::Rect::NewRect(0,0,0,0); +my $object = SDL::Rect->new(0,0,0,0); isa_ok ($object, 'SDL::Rect');