develooper Front page | perl.perl6.compiler | Postings from March 2012

[perl #111704] try BLOCK messes up $_ when used in statement-modifying contextualizers

Thread Next
From:
Moritz Lenz
Date:
March 13, 2012 02:56
Subject:
[perl #111704] try BLOCK messes up $_ when used in statement-modifying contextualizers
Message ID:
rt-3.6.HEAD-4610-1331632558-1623.111704-82-0@perl.org
# New Ticket Created by  Moritz Lenz 
# Please include the string:  [perl #111704]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org:443/rt3/Ticket/Display.html?id=111704 >


10:53 < moritz> r: try { say $_ } for <1 2>
10:53 <+p6eval> rakudo bd6742: OUTPUT«Any()␤Any()␤»

should be 1\n2\n

10:53 < moritz> r: try say $_  for <1 2>
10:53 <+p6eval> rakudo bd6742: OUTPUT«1␤2␤»
10:53 < moritz> ok, only the block case

Same with given:

10:55 < moritz> r: try { say $_ } given 2
10:55 <+p6eval> rakudo bd6742: OUTPUT«Any()␤»

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