> But ideally I'd just have this simple API:
> 
>   my $buf   = $sock->recv($len);
>   my $wrote = $sock->send($buf);
> 
> since modifying the variable that you pass to the function is going to
> be very confusing to many users. We code in perl, not C.

yeah, I think this is better.  I fluxuate between making things a C API
interface in Perl to making them perlish.  in this case (and probably
others) it looks like the perl interface is just better :)

> 
> In the first call you can check length of $buf, if you need to know how
> much was read.
> 
> In the second call, you don't need to pass the len argument. It's just
> silly to do, since we know it already, and it doesn't cost us anything
> to retrieve it from C.

you mean we have the length stored in the sv, right?

sounds good to me. make it so, number one ;)

--Geoff

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to