develooper Front page | perl.perl6.compiler | Postings from July 2010

[perl #62008] .fmt and ~ on hash values differ by a final newline

From:
Will Coleda via RT
Date:
July 27, 2010 17:52
Subject:
[perl #62008] .fmt and ~ on hash values differ by a final newline
Message ID:
rt-3.6.HEAD-11314-1280278322-1169.62008-15-0@perl.org
On Tue Jan 06 03:34:42 2009, masak wrote:
> <p6eval> rakudo 35017: OUTPUT«1   2␤3      4␤␤»
> <masak> rakudo: say {1 => 2, 3 => 4}.fmt("%s\t%s")
> <p6eval> rakudo 35017: OUTPUT«1   2␤3      4␤»
> <masak> oy! what with the extra newline in the stringification case?
> * masak submits rakudobug
> <moritz_> where is the bug?
> <masak> moritz_: it might be considered a bug that the last two
> results differ.
> <moritz_> so what does "%s\t%s" mean on hash?
> <masak> moritz_: key, tab char, value
> <moritz_> masak: and how should they the separated?
> <masak> by newlines, that's the default.
> <masak> but the operative word is 'separated'
> <masak> there shouldn't be a final newline
> <masak> (apart from the one that 'say' outputs)

The subject of this ticket mentions ~, but it looks like that example was cutoff in the snippet 
above. Can you regen it?

-- 
Will "Coke" Coleda



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