K
kj
I'm attempting to hack the Perl internals, something I know very
little of. So I apologize ahead of time for the cluelessness of
this question.
I want to implement a function via Inline::C such that, depending
on context, it returns either a scalar or a list of two values.
(This function will access the internals of other variables, and I
want to make it as fast as possible, hence the decision to code it
in C).
Since C is not capable of optionally returning a scalar or a list,
I don't even know where to begin with this.
Any advice would be much appreciated. In particular, I'd love to
look at source code for a simple function (in C) that returns a
scalar or a list according to calling context.
Thanks!
kj
little of. So I apologize ahead of time for the cluelessness of
this question.
I want to implement a function via Inline::C such that, depending
on context, it returns either a scalar or a list of two values.
(This function will access the internals of other variables, and I
want to make it as fast as possible, hence the decision to code it
in C).
Since C is not capable of optionally returning a scalar or a list,
I don't even know where to begin with this.
Any advice would be much appreciated. In particular, I'd love to
look at source code for a simple function (in C) that returns a
scalar or a list according to calling context.
Thanks!
kj