new example

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@842 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Dave Beazley 2000-09-04 15:43:52 +00:00
commit 40fe9281c6
7 changed files with 171 additions and 0 deletions

View file

@ -0,0 +1,21 @@
# file: example.pl
use example;
$a = 37;
$b = 42;
# Now call our C function with a bunch of callbacks
print "Trying some C callback functions\n";
print " a = $a\n";
print " b = $b\n";
print " ADD(a,b) = ", example::do_op($a,$b,$example::ADD),"\n";
print " SUB(a,b) = ", example::do_op($a,$b,$example::SUB),"\n";
print " MUL(a,b) = ", example::do_op($a,$b,$example::MUL),"\n";
print "Here is what the C callback function objects look like in Perl\n";
print " ADD = $example::ADD\n";
print " SUB = $example::SUB\n";
print " MUL = $example::MUL\n";