I like this post and looks good to me! There is no penalty for having a lexical "my" variable as an iterator in a "foreach" loop. Think about it, here $k1 and $k2 are separate things. Even if you succeed in writing this with just $_, you haven't saved anything, Perl will essentially create these vars even if you haven't given them names - they are separate things to Perl (inner $_ is separate from outer $_). Give them names! I agree!