PageRenderTime 47ms CodeModel.GetById 13ms RepoModel.GetById 0ms app.codeStats 0ms

/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
  1. # file: runme.pl
  2. use example;
  3. $a = 37;
  4. $b = 42;
  5. # Now call our C function with a bunch of callbacks
  6. print "Trying some C callback functions\n";
  7. print " a = $a\n";
  8. print " b = $b\n";
  9. print " ADD(a,b) = ", example::do_op($a,$b,$example::ADD),"\n";
  10. print " SUB(a,b) = ", example::do_op($a,$b,$example::SUB),"\n";
  11. print " MUL(a,b) = ", example::do_op($a,$b,$example::MUL),"\n";
  12. print "Here is what the C callback function objects look like in Perl\n";
  13. print " ADD = $example::ADD\n";
  14. print " SUB = $example::SUB\n";
  15. print " MUL = $example::MUL\n";