Use a cleaner looping syntax that won't barf on certain versions of perl