The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Panda::XSLoader - Load XS modules which exports C functionality and check for binary compability.

SYNOPSIS

    package MyXS;
    use Panda::XSLoader;
    
    our $VERSION = '0.1.3';
    Panda::XSLoader::bootstrap(); # loads XS and checks for binary compability
    

FUNCTIONS

load ([$module], [$VERSION], [$flags])

bootstrap ([$module], [$VERSION], [$flags])

Dynamically loads your module's C library. It is more convenient usage of:

    use DynaLoader;
    sub dl_load_flags { $flags }
    DynaLoader::bootstrap_inherit($module, $VERSION);

Or (if $flags == 0)

    use XSLoader;
    XSLoader::load($module, $VERSION);

If you don't provide $module it will be detected as caller. If no $VERSION provided, ${module}::VERSION variable will be used. If $flags is undef or not provided, 0x01 used.

Additionally, checks for binary compability with all XS modules you depend on (binary). If any of these have changed their versions, croaks.

Note that if your module provides (exports) C functions/classes/whatever to use from another XS modules, use 0x01 in $flags. Otherwise modules that use your functions won't load. So if it's the case then you can't use XSLoader as it doesn't provide such feature.

AUTHOR

Pronin Oleg <syber@crazypanda.ru>, Crazy Panda, CP Decision LTD

LICENSE

You may distribute this code under the same terms as Perl itself.