Abigail <abigail@abigail.be> writes:
> I probably missed it, but which bug is being fixed by forbidding to
> modify the iterator in C<< for $iterator (RANGE) >>?
If nothing else, the bug that arises when someone replaces that
C<for> with a C<map> (minimal example):
perl -e 'sub a { print($_++) for 1..3; print $/ } a;a;a'
123
123
123
perl -e 'sub a { map print($_++), 1..3; print $/ } a;a;a'
123
234
345
Eirik
--
"[..] the buzz about Ruby and Rails is the sound of a bunch of
Java programmers finally discovering how cool Perl is."
-- Piers Cawley
Thread Previous
|
Thread Next