http://www.perlmonks.org?node_id=1082759


in reply to Different result for 'foreach' vs 'while shift' arrayref

Incidentally, is there documentation of the behavior of foreach if the contents of the array are volatile during the loop?   And of unshift vs. push in such a frightful but-it-happens scenario?