in reply to Elements added to hash in for loop

Or yet simpler:
my $current_id = shift;