Eliminate use of Perl's each keyword