in reply to Re: foreach funny business
in thread foreach funny business

Bug or undefined behaviour? FWIW ive seen this issue with DDS in all kinds of places. It seems to be OS and version dependent. The question comes down to whether shift returns an alias to the item shifted out or if it returns a copy. Similar is whether \\$foo returns a reference to a readonly value or not.

Personally i think that the "reasonable" behaviour is to return a copy as that is the most DWIM behaviour.

---
$world=~s/war/peace/g