in reply to Elements added to hash in for loop

Or something like:

sub next_clauseid { my $current_id = shift(@_); ...
Note the usage of shift

If you tell me, I'll forget.
If you show me, I'll remember.
if you involve me, I'll understand.
--- Author unknown to me