[perl #62478] C-style for loop does not give an error

2010-03-09 Thread Will Coleda via RT
On Tue Jan 20 09:25:16 2009, moritz wrote: > On Sat Jan 17 14:44:21 2009, szab...@gmail.com wrote: > > for (my $i = 1; $i <= 3; $i++) { say $i; } > > > > prints 2 instead of giving an intelligent error message that one > > should use loop > > or better yet for 1..3 -> $i { } > > Since the for-lo

Re: [perl #62478] C-style for loop does not give an error

2009-01-20 Thread Andy_Bach
> > prints 2 instead of giving an intelligent error message that one should use loop > > or better yet for 1..3 -> $i { } > Presumably "say $_" would also yield 2, since I gather the for is looping over ($i). $ perl6 -e ' for (my $i = 1; $i <= 3; $i++) { say $i; }' 2 $ perl6 -e ' for (my $i = 1

Re: [perl #62478] C-style for loop does not give an error

2009-01-18 Thread Mark J. Reed
On Sat, Jan 17, 2009 at 5:44 PM, via RT Gabor Szabo wrote: > for (my $i = 1; $i <= 3; $i++) { say $i; } > > prints 2 instead of giving an intelligent error message that one should use > loop > or better yet for 1..3 -> $i { } A warning, surely? As far as I can tell, the above is perfectly lega

[perl #62478] C-style for loop does not give an error

2009-01-18 Thread via RT
# New Ticket Created by Gabor Szabo # Please include the string: [perl #62478] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=62478 > for (my $i = 1; $i <= 3; $i++) { say $i; } prints 2 instead of giving an intelligent err