## Foo.pm ## package Foo; use strict; require Exporter; *import = \&Exporter::import; require DynaLoader; $Foo::VERSION = '0.01'; DynaLoader::bootstrap Foo $Foo::VERSION; @Foo::EXPORT = qw(foo); @Foo::EXPORT_OK = (); sub dl_load_flags {0} # Prevent DynaLoader from complaining and croaking 1; __END__ ## Makefile.PL ## use ExtUtils::MakeMaker; my %options = %{ { 'TYPEMAPS' => [ 'C:\\perl510_M\\5.10.0\\lib\\ExtUtils\\typemap' ], 'NAME' => 'Foo', 'INC' => '-IC:/temp/Foo_build', 'VERSION' => '0.01' } }; WriteMakefile(%options); # Remove the Makefile dependency. Causes problems on a few systems. sub MY::makefile { '' } __END__ ## test.pl ## use Foo; $x = 17; $y = 31; $z = foo($x, $y); if($z == 48){print "ok 1\n"} else {print "not ok 1 $z\n"} __END // Foo.xs // #include "EXTERN.h" #include "perl.h" #include "XSUB.h" int foo(int x, int y) { return x + y; } MODULE = Foo PACKAGE = Foo PROTOTYPES: DISABLE int foo (x, y) int x int y