Replace each() with for() [ref: http://blogs.perl.org/users/rurban/2014/04/do-not-use-each.html]