in reply to POD in XS
As BrowserUk said, you'd generally have a .pm file that loads your XS - you can put your POD documentation into the .pm file.
That said though, it is possible to add pod to an .xs file. Just include the pod in a C comment...
#include "EXTERN.h" #include "perl.h" #include "XSUB.h" #include "ppport.h" MODULE = Mytest PACKAGE = Mytest void hello() CODE: printf("Hello, world!\n"); /* =head1 NAME Mytest - this is a test! =cut */
Note the start of the comment needs to be indented for the benefit of xsubpp. Not sure if the end of the comment needs to be, but no harm in doing so. Don't forget the =cut.
Now, that gives you pod in XS. You should be able to run something like pod2man on it and it will work. EU:MM will not automatically find the pod there and install it for the end user though. You can probably play some games with Pod::Man in your Makefile.PL.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: POD in XS
by bulk88 (Priest) on Mar 19, 2012 at 20:05 UTC |