develooper Front page | perl.perl5.porters | Postings from April 2013

[perl #117791] IO::Handle POD misleading about write

Thread Next
From:
James E Keenan via RT
Date:
April 28, 2013 23:31
Subject:
[perl #117791] IO::Handle POD misleading about write
Message ID:
rt-3.6.HEAD-28177-1367191850-1001.117791-15-0@perl.org
On Sun Apr 28 14:18:35 2013, dom wrote:
> 
> This is a bug report for perl from dom@earth.li,
> generated with the help of perlbug 1.39 running under perl 5.14.2.
> 
> 
> -----------------------------------------------------------------
> From <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=335694>
> 
> "IO::Handle(3perl) writes:
> 
>   $io->write ( BUF, LEN [, OFFSET ] )
>       This "write" is like "write" found in C, that is it is the
>    opposite
>       of read. The wrapper for the perl "write" function is called
>    "for-
>       mat_write".
> 
> I think 'like "write"' is far from the truth. The actual code is just
> a simple PERL "print" statement instead of "syswrite". This means that
> the return value is always 1 (in case of success) instead of the
> number of actually written bytes as a programmer could expect.
> 
> A big warning required here in the man page:
> "This is just a wrapper around print. A C like "write" is "syswrite".
> 
> Gabor"
> 
> Patch attached. Please leave feedback on the ticket, and I will commit
> this to blead post-freeze.

+1 overall, but I would change:

function always returns 1

to:

function upon success always returns C<1>


Thank you very much.
Jim Keenan

---
via perlbug:  queue: perl5 status: new
https://rt.perl.org:443/rt3/Ticket/Display.html?id=117791

Thread Next


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