PageRenderTime 26ms CodeModel.GetById 18ms app.highlight 6ms RepoModel.GetById 1ms app.codeStats 0ms

/trunk/Examples/perl5/funcptr/runme.pl

#
Perl | 21 lines | 13 code | 6 blank | 2 comment | 0 complexity | 32c686c48318b8306f16542707c2443e MD5 | raw file
 1# file: runme.pl
 2
 3use example;
 4
 5$a = 37;
 6$b = 42;
 7
 8# Now call our C function with a bunch of callbacks
 9
10print "Trying some C callback functions\n";
11print "    a        = $a\n";
12print "    b        = $b\n";
13print "    ADD(a,b) = ", example::do_op($a,$b,$example::ADD),"\n";
14print "    SUB(a,b) = ", example::do_op($a,$b,$example::SUB),"\n";
15print "    MUL(a,b) = ", example::do_op($a,$b,$example::MUL),"\n";
16
17print "Here is what the C callback function objects look like in Perl\n";
18print "    ADD      = $example::ADD\n";
19print "    SUB      = $example::SUB\n";
20print "    MUL      = $example::MUL\n";
21