Don't relate it anyhow to foreach of perl I would say, although the behaviour may be same in some aspect