swig/Examples/perl5/funcptr/example.pl
Dave Beazley 40fe9281c6 new example
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@842 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2000-09-04 15:43:52 +00:00

21 lines
605 B
Perl

# 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";