I've just finished doing some XSUB work, following along with the perlxstut manpage. After finishing, I attempted to add the named of some of the functions from the xs code to "all" EXPORT_TAG of the module. This does not seem to work. So if my xsub defined procedures a, b, and c neither adding qw(a b c) or qw(&a &b &c) seems to have any effect.
I have noticed that the h2xs-generated code contains a comment that says "Preloaded methods go here", but neither the perlxs or perlxstut talks about "preloading" - does this have anything to do with it?
Code below (with stuff renamed slightly).
Thanks, ---------package toolong::totypeeverytime; use 5.008005; use strict; use warnings; use Carp; require Exporter; use AutoLoader; our @ISA = qw(Exporter); # Items to export into callers namespace by default. Note: do not expo +rt # names by default without a very good reason. Use EXPORT_OK instead. # Do not simply export all your public functions/methods/constants. # This allows declaration use foo ':all'; # If you do not need this, moving things directly into @EXPORT or @EXP +ORT_OK # will save memory. our %EXPORT_TAGS = ( 'all' => [ qw( a b c ) ] ); our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } ); our @EXPORT = qw( ); our $VERSION = '0.01'; require XSLoader; XSLoader::load('foo', $VERSION); # Preloaded methods go here. 1;
In reply to exporting subs from a .so by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |