in reply to Hash of hashes returning to many values

my $sc = scalar(%messagerecbin);

Side note: This tells you about used/allocated buckets in your hash. Do you want the size of your hash? Use this:

my $sc = scalar keys %messagerecbin;

As for the "repeats", there's a trailing "}" on your code fragment -- what is that from? The fragment you posted should write four lines --- so the repeats are probably from a loop that is enclosing the fragment. You need to post more code for a diagnosis.

As a code style question, is there a reason that you're calling &writelog() with an ampersand? It's not necessary in modern Perl unless you need to circumvent prototypes, which you shouldn't be using anyway. (See perlsub for details.)

-xdg

Code written by xdg and posted on PerlMonks is public domain. It is provided as is with no warranties, express or implied, of any kind. Posted code may not have been tested. Use of posted code is at your own risk.