develooper Front page | perl.perl5.porters | Postings from July 2009

[perl #67912] syswrite prints garbage if called with empty scalar and non-zero offset

Thread Next
From:
David Taylor
Date:
July 27, 2009 03:25
Subject:
[perl #67912] syswrite prints garbage if called with empty scalar and non-zero offset
Message ID:
rt-3.6.HEAD-2466-1248681692-183.67912-75-0@perl.org
# New Ticket Created by  David Taylor 
# Please include the string:  [perl #67912]
# in the subject line of all future correspondence about this issue. 
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=67912 >


In a stock 5.10.0 perl with the default build options, syswrite prints
garbage if called with the empty string as the scalar and a non-zero
offset:

$ /usr/local/refperl/5.10.0/bin/perl -e 'my $foo = ""; syswrite
STDOUT, $foo, 100, 1' | less
<DC>8   /null^@^@^@^Y^@^@^@^A^@^@^@     ^@^@^@^P^@^@^@X^V9
^@^@^@^@<89>^@^@^@<80><A6>^U^H^@^@^@^@^@<A6>^U^H^@^@^@^@<80><A7>^U^H^@^@^@^@^@
<A7>^U^H^@^@^@^@<80><A8>^U^H^@^@^@^@^@<A9>^U^H^@^@^@^@^@<A5>^U^H^@^@^@^@<80><A4>^U^H^@
(END)

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