FFI::Library - Perl Access to Dynamically Loaded Libraries
use FFI::Library; $lib = FFI::Library->new("mylib"); $fn = $lib->function("fn", "signature"); $ret = $fn->(...);
This module provides access from Perl to functions exported from dynamically linked libraries. Functions are described by signatures, for details of which see the FFI module's documentation.
signatures
$clib_file = ($^O eq "MSWin32") ? "MSVCRT40.DLL" : "-lc"; $clib = FFI::Library->new($clib_file); $strlen = $clib->function("strlen", "cIp"); $n = $strlen->($my_string);
This module can be distributed under the same terms as Perl. However, as it depends on the FFI module, please note the licensing terms for the FFI code.
This is a maintenance release. We will be releasing an updated but incompatible 2.00 version shortly.
Paul Moore, <gustav@morpheus.demon.co.uk> is the original author of FFI.
<gustav@morpheus.demon.co.uk>
Mitchell Charity <mcharity@vendian.org> contributed fixes.
<mcharity@vendian.org>
Anatoly Vorobey <avorobey@pobox.com> and Gaal Yahas <gaal@forum2.org> are the current maintainers.
<avorobey@pobox.com>
<gaal@forum2.org>
The FFI module.
To install FFI, copy and paste the appropriate command in to your terminal.
cpanm
cpanm FFI
CPAN shell
perl -MCPAN -e shell install FFI
For more information on module installation, please visit the detailed CPAN module installation guide.