Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^2: XS: Converting a data structure in a string

by cosimo (Hermit)
on Nov 06, 2005 at 17:24 UTC ( [id://506120]=note: print w/replies, xml ) Need Help??


in reply to Re: XS: Converting a data structure in a string
in thread XS: Converting a data structure in a string

There's a conceptual flaw in your sub. The splice would increase the number of elements in the array, but your alen variable isn't going up, so there will be a number of elements you never get to.
The original perl function already works as you wrote. My XS is only a "sketch" version now and does not handle this "problem".
Is there a possibility that the data structure will be more than two levels deep? If so, you'll need a recursive function.

As you noted, this is not necessary.
The recursive solution was our first perl version. Then I wrote a non-recursive version that cuts down stack usage by a good factor. This is the actual function that I want to rewrite in XS.

You're going to need to take a look at the perlcall docs

Thanks for your suggestion.

  • Comment on Re^2: XS: Converting a data structure in a string

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://506120]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (3)
As of 2024-04-16 14:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found