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


in reply to Re: push foreach glob - bug?
in thread push foreach glob - bug?

Modifying elements of an array over which one is iterating doesn't cause problems. It's done all the time:
s/^\s+//, s/\s+$// for @array;