in reply to foreach array manipulation
Feature. for/foreach variables are refences (in the C meaning) instead of copies. If you want to copy, try this:
@test = (1,2,3,4); foreach (@test) { my $_tempvar = $_; $_tempvar = "A"; } print @test; [download]