Nick Ing-Simmons wrote:
Reinhard Pagitsch <[EMAIL PROTECTED]> writes:Whats about the REFCNT? Can you please explain or give me a link where I can read it?
Best I can suggest in perl docs is
"Reference Counts and Mortality" in perlguts.pod
But I agree that isn't a tutorial. I can't recommend a book off hand.
Thank's I will read it.
Because I load a binary file and parse its content. The file has records which I have to parseI not want to pass an arry to my XS, I want to get back an array.
BTW is there a XS function like the strtok() in C or the split() in Perl? I did not find one in the Activestate documentation.
XS _is_ C code so you can use C functions.
I tryed the strtok() function but Perl crashes.
strtok() is a tricky thing - raw strtok() uses static data between calls so it thread hostile.
I usually use split() in perl code and then pass results to the XS,
or for simple cases something like:
Why? Perl's split is very flexible and well optimized for creating perl arrays from strings.
for specific informations which I do in a XS function. If I could call the split from my XS function maybe
I could use it. The records are having not all the same length so I have to look first of the length of each record,
than I have to look if the record contain the informations I want and than I can scan the rest of it for them, store
it in a string variable, but there are also informations in the record which I do not want, so I filter them out and replace it by a space
character. Now in the string only the information I want, mostly. Now I can split the string into the pices using the space character
as delimiter.
The problem is that the file is in EBCDIC format so I have to convert the data I get to ASCII, which is done by some source
code from Steffen Beyer.
Sure for special cases you could do better, but I doubt that using another clumsy general purpose thing like strtok() would be better.
mit freundlichen GrÃÃen, with my best regards, Reinhard