/trunk/Examples/perl5/funcptr/runme.pl
Perl | 21 lines | 13 code | 6 blank | 2 comment | 0 complexity | 32c686c48318b8306f16542707c2443e MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
- # file: runme.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";