in reply to Calling builtin functions from Inline::C

I don't know about better, it really all depends on how you're passing around zs and if/where it's being read in other parts of your code. If I was going to do this, I would either implement the reading in straight C or use PerlIO_read (perlapio) if portability is desired. And I know it's just a snippet but the one thing I would not do is return a -1 to the calling perl function - an undef is more idiomatic (&PL_sv_undef).

-derby

  • Comment on Re: Calling builtin functions from Inline::C

Replies are listed 'Best First'.
Re: Re: Calling builtin functions from Inline::C
by diotalevi (Canon) on Aug 04, 2003 at 14:20 UTC

    Ok, so if I use PerlIO_read() (the matching PerlIO call) that respects perlish filehandles where really they might be tied things, objects, actual filehandles, handles to *DATA, or other odd things? Or if I want to handle all the magic correctly do I just need to have a wrapper function like sub read { CORE::read( ... ) }?