develooper Front page | perl.perl5.porters | Postings from December 2011

[perl #72244] perlapi.pod docs sv_gets() append parameter unclear

From:
James E Keenan via RT
Date:
December 11, 2011 10:37
Subject:
[perl #72244] perlapi.pod docs sv_gets() append parameter unclear
Message ID:
rt-3.6.HEAD-5084-1323628614-1993.72244-15-0@perl.org
On Wed Jan 20 13:40:42 2010, kryde wrote:
> In perlapi.pod the docs of sv_gets() doesn't say what the "append"
> parameter should be to have an append.  Is it a boolean, or is it a
> position to store to?
> 
> From I bit of experimenting I guess utf8 and "fast" buffered handles
> take it as a byte position, and the unbuffered handle case uses it as
> a boolean.  Everywhere I could spot in perl itself passes either 0 or
> SvCUR(sv), so the two interpretations behave the same ...
> 

For reference for anyone who can address this ticket, from 'perlapi'
from 5.14.2:
###
sv_gets: Get a line from the filehandle and store it into the SV,
optionally appending to the currently-stored string.

    char*   sv_gets(SV *const sv, PerlIO *const fp, I32 append)
####




nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About