in reply to Printing a int as hex

I don't see quite enough information to answer the question.

Could you replace your foreach loop with this and post the results?

foreach my $id (sort keys %hash) { print "\$hash{$id} = '$hash{$id}'\n"; my $counterValue = $hash{$id}{"counter"}; print " -> counter = '$counterValue'\n"; }

Thanks!