T
Thomas
I've spent several hours now reading documentation, a tutorial and a
magazine article on perlxs and I can't get a minimal example to run.
What I want to accomplish:
* Write some data into a C char array in C code, e.g. like this:
void set_data(char * s)
{
s[0] = 'a';
s[1] = 'b';
}
* Call that C function from a Perl module and use the String from within
a Perl program. For the moment, just print it to stdout.
Can anyone provide me with a small running example which I can extend?
At http://search.cpan.org/~rgarcia/perl-5.10.0/pod/perlxs.pod there are
many pages of documentation but no concise instructions on what to do.
Other tutorials start with a call to h2xs and pages of modifications to
be made just for me to learn that the whole thing doesn't work (example:
"change line with X to Y", only there is no line X). I'd like to use a
small working example if you know of such a thing. If not, maybe someone
can write it up, it shouldn't be more than a couple of lines?!
Part of my problem is that I don't know which tools to use on which
files in what order. Documentation is lengthy, but that basic
information seems to be missing. All solutions seem to work with lengthy
Makefile constructs which I'd like to avoid for the time being.
Thanks in advance, any help very much appreciated.
magazine article on perlxs and I can't get a minimal example to run.
What I want to accomplish:
* Write some data into a C char array in C code, e.g. like this:
void set_data(char * s)
{
s[0] = 'a';
s[1] = 'b';
}
* Call that C function from a Perl module and use the String from within
a Perl program. For the moment, just print it to stdout.
Can anyone provide me with a small running example which I can extend?
At http://search.cpan.org/~rgarcia/perl-5.10.0/pod/perlxs.pod there are
many pages of documentation but no concise instructions on what to do.
Other tutorials start with a call to h2xs and pages of modifications to
be made just for me to learn that the whole thing doesn't work (example:
"change line with X to Y", only there is no line X). I'd like to use a
small working example if you know of such a thing. If not, maybe someone
can write it up, it shouldn't be more than a couple of lines?!
Part of my problem is that I don't know which tools to use on which
files in what order. Documentation is lengthy, but that basic
information seems to be missing. All solutions seem to work with lengthy
Makefile constructs which I'd like to avoid for the time being.
Thanks in advance, any help very much appreciated.