On Thu, Apr 2, 2009 at 06:53, Irfan Sayed <[email protected]> wrote:
snip
>> http://search.cpan.org/search?query=Inline::C&mode=module
>> http://search.cpan.org/search?query=FFI&mode=module
snip
> sorry i did not get. could you please explain once again
snip
Inline::C is a module that allows you to easily write and call C
functions. Get someone to show you how to write a simple C program
that calls the functions you want to call in the library (the .so).
Once you know how to write those C function you can add them to your
Perl script with Inline::C like this:
#!/usr/bin/perl
use strict;
use warnings;
use Inline C => "DATA";
print num_of_characters("abcdef"), "\n";
__DATA__
__C__
int num_of_characters(char* string) {
int i;
for (i = 0; string[i] != '\0'; i++) {}
return i;
}
You may also want to read this article: http://www.perlmonks.org/?node_id=151114
If you do not understand any of this, well you either have a lot of
studying ahead of you, or it is time to hire a consultant.
--
Chas. Owens
wonkden.net
The most important skill a programmer can have is the ability to read.
--
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
http://learn.perl.org/