Sunday, March 3, 2013

inline::c

inline::C
Inline::C is a module that allows you to write Perl subroutines in C. Since version 0.30 the Inline module supports multiple programming languages and each language has its own support module. 

Example

use Inline 'C';

print "9 + 16 = ", add(9, 16), "\n";
print "9 - 16 = ", subtract(9, 16), "\n";

__END__
__C__

int add(int x, int y) {
 return x + y;
}

int subtract(int x, int y) {
 return x - y;

More experiments to follow...


Cheers

No comments: