in reply to Re^2: diamond operator multiple input
in thread diamond operator multiple input

Is that "for" loop syntax something that was introduced with 5.10? I tried that script with 5.8.8 and had two problems with it. First, the snippet as you posted it gave me this sort of error:
$ perl -e 'use strict; for my ($d,$v){ $_=lc<>; chomp; } print "got $d and $v\n"' Missing $ on loop variable at -e line 1.
I could get rid of that with an extra set of parens, but then there were scoping issues, because the two variables were limited to the scope of the "for" loop:
$ perl -e 'use strict; for (my($d,$v)){ $_=lc<>; chomp; } print "got $d and $v\n"' Global symbol "$d" requires explicit package name at -e line 2. Global symbol "$v" requires explicit package name at -e line 2. Execution of -e aborted due to compilation errors.
Interestingly, neither of those problems seems to affect GrandFather's snippet -- the following not only compiles, but when you feed it data, it does what it's supposed to do:
$ perl -e 'use strict; ($_=lc <>), chomp for my ($d,$v); print "got $d and $v\n"'
Again, I'm only looking at 5.8.8 -- it would be good to know whether 5.10 has different behavior in this regard.