>>>>> "Dermot" == Dermot <paik...@googlemail.com> writes:
Dermot> My first impression was that it would be 4. However, without running Dermot> it, I would say 0 on the basis that $b is scoped within the loop and Dermot> (not sure about this point) is a copy of the value in $a{1}. That's the nice thing about foreach. The loop variable is aliasing, not copying, so if there are lvalues in the list, they retain their lvalue-ness: $_ *= 3 for @somelist; multiplies each element by 3, for example. -- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 <mer...@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/> Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc. See http://methodsandmessages.vox.com/ for Smalltalk and Seaside discussion